From 5010b8be45dbcb47db69f3e716238a08d91a729c Mon Sep 17 00:00:00 2001 From: cuz Date: Tue, 16 Dec 2003 21:08:13 +0000 Subject: [PATCH] Use changed EM decls git-svn-id: svn://svn.cc65.org/cc65/trunk@2773 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/c128/c128-georam.s | 12 ++++++------ libsrc/c128/c128-ram.s | 22 +++++++++++----------- libsrc/c128/c128-ramcart.s | 10 +++++----- libsrc/c128/c128-reu.s | 2 +- libsrc/c128/c128-vdc.s | 18 +++++++++--------- libsrc/c16/c16-ram.s | 18 +++++++++--------- libsrc/c64/c64-georam.s | 12 ++++++------ libsrc/c64/c64-ram.s | 22 +++++++++++----------- libsrc/c64/c64-ramcart.s | 10 +++++----- libsrc/c64/c64-reu.s | 4 ++-- libsrc/c64/c64-vdc.s | 14 +++++++------- libsrc/cbm510/cbm510-ram.s | 12 ++++++------ libsrc/cbm610/cbm610-ram.s | 12 ++++++------ libsrc/em/em-kernel.s | 9 ++++----- 14 files changed, 88 insertions(+), 89 deletions(-) diff --git a/libsrc/c128/c128-georam.s b/libsrc/c128/c128-georam.s index c521e4a4b..5199e2ee4 100644 --- a/libsrc/c128/c128-georam.s +++ b/libsrc/c128/c128-georam.s @@ -22,7 +22,7 @@ ; Driver signature .byte $65, $6d, $64 ; "emd" - .byte $00 ; EM API version number + .byte EMD_API_VERSION ; EM API version number ; Jump table. @@ -225,7 +225,7 @@ setup: sta ptr1 ; Get the page number from the struct and adjust it so that it may be used ; with the hardware. That is: lower 6 bits in tmp1, high bits in tmp2. - ldy #EM_COPY_PAGE+1 + ldy #EM_COPY::PAGE+1 lda (ptr1),y sta tmp2 dey @@ -240,16 +240,16 @@ setup: sta ptr1 ; Get the buffer pointer into ptr2 - ldy #EM_COPY_BUF + ldy #EM_COPY::BUF lda (ptr1),y sta ptr2 iny lda (ptr1),y - sta ptr2+1 + sta ptr2+1 ; Get the count, calculate -(count-1) and store it into ptr3 - ldy #EM_COPY_COUNT + ldy #EM_COPY::COUNT lda (ptr1),y eor #$FF sta ptr3 @@ -260,7 +260,7 @@ setup: sta ptr1 ; Get the page offset into X and clear Y - ldy #EM_COPY_OFFS + ldy #EM_COPY::OFFS lda (ptr1),y tax ldy #$00 diff --git a/libsrc/c128/c128-ram.s b/libsrc/c128/c128-ram.s index 3c7e9b70e..1211c444d 100644 --- a/libsrc/c128/c128-ram.s +++ b/libsrc/c128/c128-ram.s @@ -23,7 +23,7 @@ ; Driver signature .byte $65, $6d, $64 ; "emd" - .byte $00 ; EM API version number + .byte EMD_API_VERSION ; EM API version number ; Jump table. @@ -165,16 +165,16 @@ COPYFROM: sta ptr3 stx ptr3+1 ; Save the passed em_copy pointer - ldy #EM_COPY_OFFS + ldy #EM_COPY::OFFS lda (ptr3),y sta ptr1 - ldy #EM_COPY_PAGE + ldy #EM_COPY::PAGE lda (ptr3),y clc adc #>BASE sta ptr1+1 ; From - ldy #EM_COPY_BUF + ldy #EM_COPY::BUF lda (ptr3),y sta ptr2 iny @@ -184,7 +184,7 @@ COPYFROM: lda #BASE sta ptr1+1 ; To - ldy #EM_COPY_BUF + ldy #EM_COPY::BUF lda (ptr3),y sta ptr2 iny @@ -249,7 +249,7 @@ COPYTO: sta ptr3 lda #BASE sta ptr1+1 ; From - ldy #EM_COPY_BUF + ldy #EM_COPY::BUF lda (ptr3),y sta ptr2 iny lda (ptr3),y sta ptr2+1 ; To -common: ldy #EM_COPY_COUNT+1 +common: ldy #EM_COPY::COUNT+1 lda (ptr3),y ; Get number of pages beq @L2 ; Skip if no full pages sta tmp1 @@ -214,7 +214,7 @@ common: ldy #EM_COPY_COUNT+1 ; Copy the remainder of the page -@L2: ldy #EM_COPY_COUNT +@L2: ldy #EM_COPY::COUNT lda (ptr3),y ; Get bytes in last page beq @L4 tax @@ -249,15 +249,15 @@ common: ldy #EM_COPY_COUNT+1 COPYTO: sta ptr3 stx ptr3+1 ; Save the passed em_copy pointer - ldy #EM_COPY_OFFS + ldy #EM_COPY::OFFS lda (ptr3),y sta ptr2 - ldy #EM_COPY_PAGE + ldy #EM_COPY::PAGE lda (ptr3),y add #>BASE sta ptr2+1 ; To - ldy #EM_COPY_BUF + ldy #EM_COPY::BUF lda (ptr3),y sta ptr1 iny diff --git a/libsrc/c64/c64-georam.s b/libsrc/c64/c64-georam.s index fc003b6aa..0e33b8d94 100644 --- a/libsrc/c64/c64-georam.s +++ b/libsrc/c64/c64-georam.s @@ -22,7 +22,7 @@ ; Driver signature .byte $65, $6d, $64 ; "emd" - .byte $00 ; EM API version number + .byte EMD_API_VERSION ; EM API version number ; Jump table. @@ -86,7 +86,7 @@ PAGECOUNT: ; The GeoRAM cartridge does not copy but actually map the window, so USE is ; identical to MAP. -USE = MAP +USE = MAP ; ------------------------------------------------------------------------ ; MAP: Map the page in a/x into memory and return a pointer to the page in @@ -225,7 +225,7 @@ setup: sta ptr1 ; Get the page number from the struct and adjust it so that it may be used ; with the hardware. That is: lower 6 bits in tmp1, high bits in tmp2. - ldy #EM_COPY_PAGE+1 + ldy #EM_COPY::PAGE+1 lda (ptr1),y sta tmp2 dey @@ -240,7 +240,7 @@ setup: sta ptr1 ; Get the buffer pointer into ptr2 - ldy #EM_COPY_BUF + ldy #EM_COPY::BUF lda (ptr1),y sta ptr2 iny @@ -249,7 +249,7 @@ setup: sta ptr1 ; Get the count, calculate -(count-1) and store it into ptr3 - ldy #EM_COPY_COUNT + ldy #EM_COPY::COUNT lda (ptr1),y eor #$FF sta ptr3 @@ -260,7 +260,7 @@ setup: sta ptr1 ; Get the page offset into X and clear Y - ldy #EM_COPY_OFFS + ldy #EM_COPY::OFFS lda (ptr1),y tax ldy #$00 diff --git a/libsrc/c64/c64-ram.s b/libsrc/c64/c64-ram.s index b0a60c1d9..f176eda49 100644 --- a/libsrc/c64/c64-ram.s +++ b/libsrc/c64/c64-ram.s @@ -22,7 +22,7 @@ ; Driver signature .byte $65, $6d, $64 ; "emd" - .byte $00 ; EM API version number + .byte EMD_API_VERSION ; EM API version number ; Jump table. @@ -162,7 +162,7 @@ loop: .repeat 8 ; Done -done: rts +done: rts ; ------------------------------------------------------------------------ ; COPYFROM: Copy from extended into linear memory. A pointer to a structure @@ -173,24 +173,24 @@ done: rts COPYFROM: sta ptr3 stx ptr3+1 ; Save the passed em_copy pointer - - ldy #EM_COPY_OFFS + + ldy #EM_COPY::OFFS lda (ptr3),y sta ptr1 - ldy #EM_COPY_PAGE + ldy #EM_COPY::PAGE lda (ptr3),y clc adc #>BASE sta ptr1+1 ; From - ldy #EM_COPY_BUF + ldy #EM_COPY::BUF lda (ptr3),y sta ptr2 iny lda (ptr3),y sta ptr2+1 ; To -common: ldy #EM_COPY_COUNT+1 +common: ldy #EM_COPY::COUNT+1 lda (ptr3),y ; Get number of pages beq @L2 ; Skip if no full pages sta tmp1 @@ -206,7 +206,7 @@ common: ldy #EM_COPY_COUNT+1 ; Copy the remainder of the page -@L2: ldy #EM_COPY_COUNT +@L2: ldy #EM_COPY::COUNT lda (ptr3),y ; Get bytes in last page beq @L4 tax @@ -245,16 +245,16 @@ common: ldy #EM_COPY_COUNT+1 COPYTO: sta ptr3 stx ptr3+1 ; Save the passed em_copy pointer - ldy #EM_COPY_OFFS + ldy #EM_COPY::OFFS lda (ptr3),y sta ptr2 - ldy #EM_COPY_PAGE + ldy #EM_COPY::PAGE lda (ptr3),y clc adc #>BASE sta ptr2+1 ; To - ldy #EM_COPY_BUF + ldy #EM_COPY::BUF lda (ptr3),y sta ptr1 iny diff --git a/libsrc/c64/c64-ramcart.s b/libsrc/c64/c64-ramcart.s index bd7741048..43e42af3b 100644 --- a/libsrc/c64/c64-ramcart.s +++ b/libsrc/c64/c64-ramcart.s @@ -24,7 +24,7 @@ ; Driver signature .byte $65, $6d, $64 ; "emd" - .byte $00 ; EM API version number + .byte EMD_API_VERSION ; EM API version number ; Jump table. @@ -252,7 +252,7 @@ setup: sta ptr1 ; Get the page number from the struct and adjust it so that it may be used ; with the hardware. That is: lower 6 bits in tmp1, high bits in tmp2. - ldy #EM_COPY_PAGE+1 + ldy #EM_COPY::PAGE+1 lda (ptr1),y sta tmp2 dey @@ -261,7 +261,7 @@ setup: sta ptr1 ; Get the buffer pointer into ptr2 - ldy #EM_COPY_BUF + ldy #EM_COPY::BUF lda (ptr1),y sta ptr2 iny @@ -270,7 +270,7 @@ setup: sta ptr1 ; Get the count, calculate -(count-1) and store it into ptr3 - ldy #EM_COPY_COUNT + ldy #EM_COPY::COUNT lda (ptr1),y eor #$FF sta ptr3 @@ -281,7 +281,7 @@ setup: sta ptr1 ; Get the page offset into X and clear Y - ldy #EM_COPY_OFFS + ldy #EM_COPY::OFFS lda (ptr1),y tax ldy #$00 diff --git a/libsrc/c64/c64-reu.s b/libsrc/c64/c64-reu.s index 4fd5e3db7..59dbb7913 100644 --- a/libsrc/c64/c64-reu.s +++ b/libsrc/c64/c64-reu.s @@ -22,7 +22,7 @@ ; Driver signature .byte $65, $6d, $64 ; "emd" - .byte $00 ; EM API version number + .byte EMD_API_VERSION ; EM API version number ; Jump table. @@ -142,7 +142,7 @@ done: rts ; ------------------------------------------------------------------------ ; USE: Tell the driver that the window is now associated with a given page. - + USE: sta curpage stx curpage+1 ; Remember the page lda #EM_ERR_OK - rts +; rts ; Run into UNINSTALL instead ; ------------------------------------------------------------------------ ; UNINSTALL routine. Is called before the driver is removed from memory. @@ -263,23 +263,23 @@ COPYTO: jsr setup setup: sta ptr3 stx ptr3+1 ; Save the passed em_copy pointer - ldy #EM_COPY_OFFS + ldy #EM_COPY::OFFS lda (ptr3),y add #OFFS sta ptr1 - ldy #EM_COPY_PAGE + ldy #EM_COPY::PAGE lda (ptr3),y adc #$00 sta ptr1+1 - ldy #EM_COPY_COUNT + ldy #EM_COPY::COUNT lda (ptr3),y sta ptr2 iny lda (ptr3),y sta ptr2+1 ; Get count into ptr2 - ldy #EM_COPY_BUF+1 + ldy #EM_COPY::BUF+1 lda (ptr1),y tax dey diff --git a/libsrc/cbm610/cbm610-ram.s b/libsrc/cbm610/cbm610-ram.s index 2798f83ad..af441f21d 100644 --- a/libsrc/cbm610/cbm610-ram.s +++ b/libsrc/cbm610/cbm610-ram.s @@ -22,7 +22,7 @@ ; Driver signature .byte $65, $6d, $64 ; "emd" - .byte $00 ; EM API version number + .byte EMD_API_VERSION ; EM API version number ; Jump table. @@ -73,7 +73,7 @@ INSTALL: lda #EM_ERR_OK - rts +; rts ; Run into UNINSTALL instead ; ------------------------------------------------------------------------ ; UNINSTALL routine. Is called before the driver is removed from memory. @@ -263,23 +263,23 @@ COPYTO: jsr setup setup: sta ptr3 stx ptr3+1 ; Save the passed em_copy pointer - ldy #EM_COPY_OFFS + ldy #EM_COPY::OFFS lda (ptr3),y add #OFFS sta ptr1 - ldy #EM_COPY_PAGE + ldy #EM_COPY::PAGE lda (ptr3),y adc #$00 sta ptr1+1 - ldy #EM_COPY_COUNT + ldy #EM_COPY::COUNT lda (ptr3),y sta ptr2 iny lda (ptr3),y sta ptr2+1 ; Get count into ptr2 - ldy #EM_COPY_BUF+1 + ldy #EM_COPY::BUF+1 lda (ptr1),y tax dey diff --git a/libsrc/em/em-kernel.s b/libsrc/em/em-kernel.s index 31c331f4a..1c9591e28 100644 --- a/libsrc/em/em-kernel.s +++ b/libsrc/em/em-kernel.s @@ -33,8 +33,7 @@ emd_copyto: jmp return0 ; Driver header signature .rodata -emd_sig: .byte $65, $6d, $64, $00 ; "emd", version -emd_sig_len = * - emd_sig +emd_sig: .byte $65, $6d, $64, EMD_API_VERSION ; "emd", version ;---------------------------------------------------------------------------- @@ -50,7 +49,7 @@ _em_install: ; Check the driver signature - ldy #emd_sig_len-1 + ldy #.sizeof(emd_sig)-1 @L0: lda (ptr1),y cmp emd_sig,y bne inv_drv @@ -59,12 +58,12 @@ _em_install: ; Copy the jump vectors - ldy #EMD_HDR_JUMPTAB + ldy #EMD_HDR::JUMPTAB ldx #0 @L1: inx ; Skip the JMP opcode jsr copy ; Copy one byte jsr copy ; Copy one byte - cpx #(EMD_HDR_JUMPCOUNT*3) + cpy #(EMD_HDR::JUMPTAB + .sizeof(EMD_HDR::JUMPTAB)) bne @L1 jmp emd_install ; Call driver install routine -- 2.39.5