diff --git a/docs/ADDRESS_READ_BETWEEN_BANK.md b/docs/ADDRESS_READ_BETWEEN_BANK.md new file mode 100644 index 0000000..5914656 --- /dev/null +++ b/docs/ADDRESS_READ_BETWEEN_BANK.md @@ -0,0 +1,2 @@ +# ADDRESS_READ_BETWEEN_BANK +* XWSTR0 diff --git a/docs/ADIODB_VECTOR.md b/docs/ADIODB_VECTOR.md index 4fe86ca..f36ee75 100644 --- a/docs/ADIODB_VECTOR.md +++ b/docs/ADIODB_VECTOR.md @@ -1 +1,5 @@ # ADIODB_VECTOR +* XWR0 +* XWR0 +* XRD0 +* XRD0 diff --git a/docs/ADSCR.md b/docs/ADSCR.md new file mode 100644 index 0000000..03c6437 --- /dev/null +++ b/docs/ADSCR.md @@ -0,0 +1,3 @@ +# ADSCR +* XWR0 +* XWR0 diff --git a/docs/ADSCRH.md b/docs/ADSCRH.md new file mode 100644 index 0000000..86aad81 --- /dev/null +++ b/docs/ADSCRH.md @@ -0,0 +1,3 @@ +# ADSCRH +* XWR0 +* XWR0 diff --git a/docs/ADSCRL.md b/docs/ADSCRL.md new file mode 100644 index 0000000..aa4acf2 --- /dev/null +++ b/docs/ADSCRL.md @@ -0,0 +1,3 @@ +# ADSCRL +* XWR0 +* XWR0 diff --git a/docs/CURSCR.md b/docs/CURSCR.md new file mode 100644 index 0000000..70b0283 --- /dev/null +++ b/docs/CURSCR.md @@ -0,0 +1,3 @@ +# CURSCR +* XWR0 +* XWR0 diff --git a/docs/FLGCUR.md b/docs/FLGCUR.md new file mode 100644 index 0000000..65721b3 --- /dev/null +++ b/docs/FLGCUR.md @@ -0,0 +1,3 @@ +# FLGCUR +* XWR0 +* XWR0 diff --git a/docs/FLGCUR_STATE.md b/docs/FLGCUR_STATE.md new file mode 100644 index 0000000..bb70815 --- /dev/null +++ b/docs/FLGCUR_STATE.md @@ -0,0 +1,3 @@ +# FLGCUR_STATE +* XWR0 +* XWR0 diff --git a/docs/KBDKEY.md b/docs/KBDKEY.md new file mode 100644 index 0000000..b76a88d --- /dev/null +++ b/docs/KBDKEY.md @@ -0,0 +1,3 @@ +# KBDKEY +* XRD0 +* XRD0 diff --git a/docs/KBDSHT.md b/docs/KBDSHT.md new file mode 100644 index 0000000..2cdedca --- /dev/null +++ b/docs/KBDSHT.md @@ -0,0 +1,3 @@ +# KBDSHT +* XRD0 +* XRD0 diff --git a/docs/KEYBOARD_COUNTER.md b/docs/KEYBOARD_COUNTER.md new file mode 100644 index 0000000..b066d62 --- /dev/null +++ b/docs/KEYBOARD_COUNTER.md @@ -0,0 +1,3 @@ +# KEYBOARD_COUNTER +* XRD0 +* XRD0 diff --git a/docs/ORIX_VECTOR_READ_VALUE_INTO_RAM_OVERLAY.md b/docs/ORIX_VECTOR_READ_VALUE_INTO_RAM_OVERLAY.md new file mode 100644 index 0000000..02cb976 --- /dev/null +++ b/docs/ORIX_VECTOR_READ_VALUE_INTO_RAM_OVERLAY.md @@ -0,0 +1 @@ +# ORIX_VECTOR_READ_VALUE_INTO_RAM_OVERLAY diff --git a/docs/RES.md b/docs/RES.md index d6bccd2..b3a6162 100644 --- a/docs/RES.md +++ b/docs/RES.md @@ -5,6 +5,8 @@ * kernel_create_process * kernel_kill_process * kernel_kill_process via XFREE_ROUTINE +* XDECAY +* XADRESS * XDIVIS * XREADBYTES_ROUTINE * XPUTCWD_ROUTINE diff --git a/docs/RESB.md b/docs/RESB.md index fb662dc..ff316d2 100644 --- a/docs/RESB.md +++ b/docs/RESB.md @@ -2,6 +2,7 @@ * checking_fp_exists * kernel_create_process * ZADCHA +* XDECAY * XDIVIS * XCLOSE_ROUTINE * XGETCWD_ROUTINE diff --git a/docs/SCRNB.md b/docs/SCRNB.md new file mode 100644 index 0000000..af59abc --- /dev/null +++ b/docs/SCRNB.md @@ -0,0 +1,3 @@ +# SCRNB +* XWR0 +* XWR0 diff --git a/docs/i_o_counter.md b/docs/i_o_counter.md index b971605..7b15205 100644 --- a/docs/i_o_counter.md +++ b/docs/i_o_counter.md @@ -1,3 +1,5 @@ # i_o_counter * XWR0 +* XWR0 +* XRD0 * XRD0 diff --git a/docs/i_o_save.md b/docs/i_o_save.md index df0aec5..8c6b1b8 100644 --- a/docs/i_o_save.md +++ b/docs/i_o_save.md @@ -1,3 +1,4 @@ # i_o_save * XWR0 * XWSTR0 +* XWR0 diff --git a/docs/memmap_ram.md b/docs/memmap_ram.md index bdd0872..e4ea2c0 100644 --- a/docs/memmap_ram.md +++ b/docs/memmap_ram.md @@ -135,6 +135,7 @@ |Type | Name | Range | Size | | :------- |:----------------------------- |:----------- |:-----| |RAM|page4 overlay_access | $0419-$0436 | 54 | +|RAM|page4 ORIX_VECTOR_READ_VALUE_INTO_RAM_OVERLAY | $0411-$0411 | 3 | ## Page 5&6 |Type | Name | Range | Size | | :------- |:----------------------------- |:----------- |:-----| @@ -146,12 +147,12 @@ ## Kernel bank 7 | Type | Name | Range | Size | | :-------- |:---------------------------- |:------- |:-----| -|ROM|FREE |$fef5-$fff0| 251 | -##Bank 0 +|ROM|FREE |$feee-$fff0| 258 | +## Bank 0 | Type | Name | Range | Size | | -------- | ---------------------------- | ------- |-----| |BANK0|BUFBUF | $c080-$c0b6 | 54 | |BANK0|BUFROU | $c500-$c54e | | |BANK0|TELEMON_KEYBOARD_BUFFER_BEGIN | $c5c4-$c680 | | -|BANK0|XMALLOC (copy from kernel) | $fba7-$fc53 | | -|BANK0|XFREE (copy from kernel) | $fc53-$fed8 | | +|BANK0|XMALLOC (copy from kernel) | $fba0-$fc4c | | +|BANK0|XFREE (copy from kernel) | $fc4c-$fed1 | | diff --git a/docs/work_channel.md b/docs/work_channel.md index dab1d0f..98f04b6 100644 --- a/docs/work_channel.md +++ b/docs/work_channel.md @@ -2,3 +2,5 @@ * XWR0 * XWSTR0 * XRD0 +* XRD0 +* XOP0 diff --git a/generate_memmap.sh b/generate_memmap.sh index a34023b..ec8945e 100644 --- a/generate_memmap.sh +++ b/generate_memmap.sh @@ -5,7 +5,7 @@ sed -i 's/FREE/FREE<\/span>/g' docs/memmap_ram.md sed -i 's/|#/#/g' docs/memmap_ram.md sed -i 's/MEMMAP://g' docs/memmap_ram.md -LIST="RESB RES RESC RESD RESE RESF RESG RESH TR0 TR1 TR2 TR3 TR4 TR5 TR6 TR7 work_channel i_o_save i_o_counter ADIODB_VECTOR" +LIST="RESB RES RESC RESD RESE RESF RESG RESH TR0 TR1 TR2 TR3 TR4 TR5 TR6 TR7 work_channel i_o_save i_o_counter ADIODB_VECTOR KEYBOARD_COUNTER KBDKEY KBDSHT SCRNB ADSCR FLGCUR FLGCUR_STATE CURSCR ADSCRL ADSCRH ADDRESS_READ_BETWEEN_BANK ORIX_VECTOR_READ_VALUE_INTO_RAM_OVERLAY" for I in $LIST; do diff --git a/memmap.md b/memmap.md index 8dfebef..85ec418 100644 --- a/memmap.md +++ b/memmap.md @@ -38,15 +38,50 @@ int MALLOC_FREE_END_HIGH=0x534; int MALLOC_FREE_END_LOW=0x52f; int KERNEL_MALLOC_FREE_CHUNK_MAX=0x5; |CALL:XCRLF:XWR0 +|CALL:XWR0:XCOSCR |MODIFY:work_channel:XWR0 |MODIFY:i_o_save:XWR0 |MODIFY:i_o_counter:XWR0 +|MODIFY:ADIODB_VECTOR:XWR0 +|MODIFY:SCRNB:XWR0 +|MODIFY:ADSCR:XWR0 +|MODIFY:FLGCUR:XWR0 +|MODIFY:FLGCUR_STATE:XWR0 +|MODIFY:CURSCR:XWR0 +|MODIFY:ADSCRL:XWR0 +|MODIFY:ADSCRH:XWR0 +|MODIFY:FLGSCR:XWR0 |MODIFY:i_o_save:XWSTR0 |MODIFY:work_channel:XWSTR0 |MODIFY:ADDRESS_READ_BETWEEN_BANK:XWSTR0 +|MODIFY:i_o_save:XWR0 +|MODIFY:i_o_counter:XWR0 +|MODIFY:ADIODB_VECTOR:XWR0 +|MODIFY:SCRNB:XWR0 +|MODIFY:ADSCR:XWR0 +|MODIFY:FLGCUR:XWR0 +|MODIFY:FLGCUR_STATE:XWR0 +|MODIFY:CURSCR:XWR0 +|MODIFY:ADSCRL:XWR0 +|MODIFY:ADSCRH:XWR0 +|MODIFY:FLGSCR:XWR0 |MODIFY:work_channel:XRD0 |MODIFY:i_o_counter:XRD0 +|MODIFY:ADDRESS_VECTOR_FOR_ADIOB:XRD0 +|MODIFY:ADIODB_VECTOR:XRD0 +|MODIFY:KEYBOARD_COUNTER:XRD0 +|MODIFY:KBDKEY:XRD0 +|MODIFY:KBDSHT:XRD0 |MODIFY:$1B:XRDW0 +|MODIFY:work_channel:XRD0 +|MODIFY:i_o_counter:XRD0 +|MODIFY:ADDRESS_VECTOR_FOR_ADIOB:XRD0 +|MODIFY:ADIODB_VECTOR:XRD0 +|MODIFY:KEYBOARD_COUNTER:XRD0 +|MODIFY:KBDKEY:XRD0 +|MODIFY:KBDSHT:XRD0 +|MODIFY:IOTAB:XOP0 +|MODIFY:work_channel:XOP0 |MODIFY:RES:_create_file_pointer |MODIFY:KERNEL_ERRNO:_create_file_pointer |CALL:XMALLOC:_create_file_pointer @@ -65,6 +100,8 @@ int KERNEL_MALLOC_FREE_CHUNK_MAX=0x5; |MODIFY:TR5:kernel_kill_process via XFREE_ROUTINE |MODIFY:RES:kernel_kill_process via XFREE_ROUTINE |MODIFY:RESB:ZADCHA +|MODIFY:RES:XDECAY +|MODIFY:RESB:XDECAY |MODIFY:TR0:XBINDX |MODIFY:TR1:XBINDX |MODIFY:TR2:XBINDX @@ -76,6 +113,7 @@ int KERNEL_MALLOC_FREE_CHUNK_MAX=0x5; |MODIFY:TR4:XDECIM |MODIFY:TR5:XDECIM |MODIFY:TR6:XDECIM +|MODIFY:RES:XADRESS |MODIFY:TR0:XDIVIS |MODIFY:TR1:XDIVIS |MODIFY:RES:XDIVIS @@ -321,6 +359,7 @@ CALL:XOPEN:XRM_ROUTINE |MEMMAP:Type | Name | Range | Size | |MEMMAP: :------- |:----------------------------- |:----------- |:-----| |MEMMAP:RAM|page4 overlay_access | $0419-$0436 | 54 | +|MEMMAP:RAM|page4 ORIX_VECTOR_READ_VALUE_INTO_RAM_OVERLAY | $0411-$0411 | 3 | |##MEMMAP: Page 5&6 |MEMMAP:Type | Name | Range | Size | |MEMMAP: :------- |:----------------------------- |:----------- |:-----| @@ -332,12 +371,12 @@ CALL:XOPEN:XRM_ROUTINE |##MEMMAP: Kernel bank 7 |MEMMAP: Type | Name | Range | Size | |MEMMAP: :-------- |:---------------------------- |:------- |:-----| -|MEMMAP:ROM|FREE |$fef5-$fff0| 251 | -|##MEMMAP:Bank 0 +|MEMMAP:ROM|FREE |$feee-$fff0| 258 | +|##MEMMAP: Bank 0 |MEMMAP: Type | Name | Range | Size | |MEMMAP: -------- | ---------------------------- | ------- |-----| |MEMMAP:BANK0|BUFBUF | $c080-$c0b6 | 54 | |MEMMAP:BANK0|BUFROU | $c500-$c54e | | |MEMMAP:BANK0|TELEMON_KEYBOARD_BUFFER_BEGIN | $c5c4-$c680 | | -|MEMMAP:BANK0|XMALLOC (copy from kernel) | $fba7-$fc53 | | -|MEMMAP:BANK0|XFREE (copy from kernel) | $fc53-$fed8 | | +|MEMMAP:BANK0|XMALLOC (copy from kernel) | $fba0-$fc4c | | +|MEMMAP:BANK0|XFREE (copy from kernel) | $fc4c-$fed1 | | diff --git a/src/functions/XOP.asm b/src/functions/XOP.asm index 60f39c3..400e105 100644 --- a/src/functions/XOP.asm +++ b/src/functions/XOP.asm @@ -1,8 +1,12 @@ ; A contains channel XOP0_ROUTINE: + .out .sprintf("|MODIFY:IOTAB:XOP0") + .out .sprintf("|MODIFY:work_channel:XOP0") + ldx #$00 ; Channel 0 pha + @loop: pla cmp IOTAB,x ; Already open with the same IO ? @@ -15,11 +19,11 @@ XOP0_ROUTINE: and #$03 bne @loop pla + @skip2: rts skip129: - ldy #(KERNEL_SIZE_IOTAB-1) @loop: diff --git a/src/functions/XRDW.asm b/src/functions/XRDW.asm index d3499a0..5a09fa8 100644 --- a/src/functions/XRDW.asm +++ b/src/functions/XRDW.asm @@ -2,6 +2,11 @@ XRD0_ROUTINE: lda #$00 .out .sprintf("|MODIFY:work_channel:XRD0") .out .sprintf("|MODIFY:i_o_counter:XRD0") + .out .sprintf("|MODIFY:ADDRESS_VECTOR_FOR_ADIOB:XRD0") ; with send_command_A call + .out .sprintf("|MODIFY:ADIODB_VECTOR:XRD0") ; with send_command_A call + .out .sprintf("|MODIFY:KEYBOARD_COUNTER:XRD0") ; with send_command_A call (manage_I_O_keyboard) + .out .sprintf("|MODIFY:KBDKEY:XRD0") ; with send_command_A call (manage_I_O_keyboard) + .out .sprintf("|MODIFY:KBDSHT:XRD0") ; with send_command_A call (manage_I_O_keyboard) Lc7da: sta work_channel ; Save the channel diff --git a/src/functions/XWRD.asm b/src/functions/XWRD.asm index cef6dbc..9c1985d 100644 --- a/src/functions/XWRD.asm +++ b/src/functions/XWRD.asm @@ -1,5 +1,12 @@ XRDW0_ROUTINE: .out .sprintf("|MODIFY:$1B:XRDW0") + .out .sprintf("|MODIFY:work_channel:XRD0") + .out .sprintf("|MODIFY:i_o_counter:XRD0") + .out .sprintf("|MODIFY:ADDRESS_VECTOR_FOR_ADIOB:XRD0") ; with send_command_A call + .out .sprintf("|MODIFY:ADIODB_VECTOR:XRD0") ; with send_command_A call + .out .sprintf("|MODIFY:KEYBOARD_COUNTER:XRD0") ; with send_command_A call (manage_I_O_keyboard) + .out .sprintf("|MODIFY:KBDKEY:XRD0") ; with send_command_A call (manage_I_O_keyboard) + .out .sprintf("|MODIFY:KBDSHT:XRD0") ; with send_command_A call (manage_I_O_keyboard) lda #$00 sta $1B diff --git a/src/functions/XWRx.asm b/src/functions/XWRx.asm index 2f2d158..54b6fe3 100644 --- a/src/functions/XWRx.asm +++ b/src/functions/XWRx.asm @@ -1,8 +1,18 @@ XWR0_ROUTINE: + + .out .sprintf("|CALL:XWR0:XCOSCR") .out .sprintf("|MODIFY:work_channel:XWR0") .out .sprintf("|MODIFY:i_o_save:XWR0") .out .sprintf("|MODIFY:i_o_counter:XWR0") .out .sprintf("|MODIFY:ADIODB_VECTOR:XWR0") + .out .sprintf("|MODIFY:SCRNB:XWR0") ; IOTAB + .out .sprintf("|MODIFY:ADSCR:XWR0") ; IOTAB + .out .sprintf("|MODIFY:FLGCUR:XWR0") ; IOTAB + .out .sprintf("|MODIFY:FLGCUR_STATE:XWR0") ; IOTAB + .out .sprintf("|MODIFY:CURSCR:XWR0") ; IOTAB + .out .sprintf("|MODIFY:ADSCRL:XWR0") ; IOTAB + .out .sprintf("|MODIFY:ADSCRH:XWR0") ; IOTAB + .out .sprintf("|MODIFY:FLGSCR:XWR0") ; IOTAB pha ; Push byte to write lda #$00 diff --git a/src/functions/XWSTRx.asm b/src/functions/XWSTRx.asm index c79176b..f896958 100644 --- a/src/functions/XWSTRx.asm +++ b/src/functions/XWSTRx.asm @@ -6,6 +6,17 @@ .out .sprintf("|MODIFY:i_o_save:XWSTR0") .out .sprintf("|MODIFY:work_channel:XWSTR0") .out .sprintf("|MODIFY:ADDRESS_READ_BETWEEN_BANK:XWSTR0") + .out .sprintf("|MODIFY:i_o_save:XWR0") + .out .sprintf("|MODIFY:i_o_counter:XWR0") + .out .sprintf("|MODIFY:ADIODB_VECTOR:XWR0") + .out .sprintf("|MODIFY:SCRNB:XWR0") ; IOTAB + .out .sprintf("|MODIFY:ADSCR:XWR0") ; IOTAB + .out .sprintf("|MODIFY:FLGCUR:XWR0") ; IOTAB + .out .sprintf("|MODIFY:FLGCUR_STATE:XWR0") ; IOTAB + .out .sprintf("|MODIFY:CURSCR:XWR0") ; IOTAB + .out .sprintf("|MODIFY:ADSCRL:XWR0") ; IOTAB + .out .sprintf("|MODIFY:ADSCRH:XWR0") ; IOTAB + .out .sprintf("|MODIFY:FLGSCR:XWR0") ; IOTAB ldx #$00 stx i_o_save+1 diff --git a/src/functions/xadress.asm b/src/functions/xadress.asm index a158c39..555fa83 100644 --- a/src/functions/xadress.asm +++ b/src/functions/xadress.asm @@ -1,4 +1,6 @@ ; RES +AY = RES and AY + +.out .sprintf("|MODIFY:RES:XADRESS") clc adc RES sta RES diff --git a/src/functions/xdecay.asm b/src/functions/xdecay.asm index 96a409e..db870a5 100644 --- a/src/functions/xdecay.asm +++ b/src/functions/xdecay.asm @@ -9,6 +9,9 @@ .proc XDECAY_ROUTINE +.out .sprintf("|MODIFY:RES:XDECAY") +.out .sprintf("|MODIFY:RESB:XDECAY") + sta RES ; on sauve l'adresse du nombre sty RES+1 ; dans RES ldy #$00 ; et on met RESB ? 0 diff --git a/src/kernel.asm b/src/kernel.asm index f3611e7..a496504 100644 --- a/src/kernel.asm +++ b/src/kernel.asm @@ -46,7 +46,6 @@ ADIODB_LENGTH = $08 .include "include/debug.inc" .endif - .include "orix.mac" .include "kernel.inc" .include "build.inc" @@ -1279,8 +1278,9 @@ Lc973: bit FLGSCR bpl @L3 bvs @L3 - ldx SCRNB + ;ldx SCRNB jmp LDE2D + @L3: rts @@ -1292,17 +1292,12 @@ manage_irq_T1_and_T2: ldy VIA_UNKNOWN+1 sta VIA::T2 sty VIA::T2+1 - ;lda FLGJCK - ;lsr - ;bcc routine_todefine_1 - ;jmp LC8B9 routine_todefine_1: lda #$FF sta VIA::T2+1 jmp LC8B9 - LC9b9: bit VIA::IFR @@ -1312,8 +1307,10 @@ LC9b9: ldx IRQSVX ldy IRQSVY jmp ORIX_MEMORY_DRIVER_ADDRESS + next111: jmp LC8B6 + next110: lsr TRANSITION_RS232 bit VIA::IFR @@ -1344,14 +1341,16 @@ Lca0b: Lca10: jmp LC8B9 + Lca1c: jmp manage_irq_T1_and_T2 -next112 + +next112: lda VIA::IFR and #$02 beq Lca1c bit VIA::PRA - jsr manage_printer + ;jsr manage_printer jmp LC8B9 .proc manage_printer @@ -1405,10 +1404,12 @@ Lca75: sta (ADCLK),y iny lda TIMES + telemon_display_clock_chars: ; display clock at the adress specified ldx #$2F sec + @loop: sbc #$0A inx @@ -2335,7 +2336,7 @@ LDBED: .byt <(CTRL_US_START-1),>(CTRL_US_START-1) ; US LDC2B: - ldx SCRNB ; Get screen number + ;ldx SCRNB ; Get screen number ldy SCRX ; Get position X lda (ADSCR),y ; get previous char on the cursor sta CURSCR ; and save it diff --git a/src/memmap.asm b/src/memmap.asm index cd6cad4..6c2f6af 100644 --- a/src/memmap.asm +++ b/src/memmap.asm @@ -188,6 +188,12 @@ .out "|MEMMAP:Type | Name | Range | Size |" .out "|MEMMAP: :------- |:----------------------------- |:----------- |:-----|" .out .sprintf("|MEMMAP:RAM|page4 overlay_access | $%04X-$%04X | %d |", $400+code_adress_419-code_adress_400,$400+code_adress_436-code_adress_400,code_adress_436-code_adress_400) +.out .sprintf("|MEMMAP:RAM|page4 ORIX_VECTOR_READ_VALUE_INTO_RAM_OVERLAY | $%04X-$%04X | 3 |", ORIX_VECTOR_READ_VALUE_INTO_RAM_OVERLAY,ORIX_VECTOR_READ_VALUE_INTO_RAM_OVERLAY) + + + + + .out .sprintf("|##MEMMAP: Page 5&6") .out "|MEMMAP:Type | Name | Range | Size |" @@ -206,7 +212,7 @@ .out .sprintf("|MEMMAP:ROM|FREE |$%x-$fff0| %d |", free_bytes,$fff0-free_bytes) -.out .sprintf("|##MEMMAP:Bank 0") +.out .sprintf("|##MEMMAP: Bank 0") .out "|MEMMAP: Type | Name | Range | Size |" .out "|MEMMAP: -------- | ---------------------------- | ------- |-----|" .out .sprintf("|MEMMAP:BANK0|BUFBUF | $%x-$%x | %d |", BUFBUF,BUFBUF+12*KERNEL_NUMBER_BUFFER,BUFBUF+12*KERNEL_NUMBER_BUFFER-BUFBUF)