;
-; Extended memory driver for the GEORAM cartridge
+; Extended memory driver for the GEORAM cartridge. Driver works without
+; problems when statically linked.
;
; Ullrich von Bassewitz, 2002-11-29
;
; Jump table.
.word INSTALL
- .word DEINSTALL
+ .word UNINSTALL
.word PAGECOUNT
.word MAP
.word USE
rts
; ------------------------------------------------------------------------
-; DEINSTALL routine. Is called before the driver is removed from memory.
+; UNINSTALL routine. Is called before the driver is removed from memory.
; Can do cleanup or whatever. Must not return anything.
;
-DEINSTALL:
+UNINSTALL:
rts
;
-; Extended memory driver for the C64 hidden RAM
+; Extended memory driver for the C64 hidden RAM. Driver works without
+; problems when statically linked.
;
; Ullrich von Bassewitz, 2002-12-02
;
; Jump table.
.word INSTALL
- .word DEINSTALL
+ .word UNINSTALL
.word PAGECOUNT
.word MAP
.word USE
; ------------------------------------------------------------------------
; Data.
-.data
-curpage: .byte $FF ; Current page number (invalid)
-
.bss
+curpage: .res 1 ; Current page number
window: .res 256 ; Memory "window"
.code
;
INSTALL:
- lda #<EM_ERR_OK
- ldx #>EM_ERR_OK
+ ldx #$FF
+ stx curpage ; Invalidate the current page
+ inx ; X = 0
+ txa ; A = X = EM_ERR_OK
rts
; ------------------------------------------------------------------------
-; DEINSTALL routine. Is called before the driver is removed from memory.
+; UNINSTALL routine. Is called before the driver is removed from memory.
; Can do cleanup or whatever. Must not return anything.
;
-DEINSTALL:
+UNINSTALL:
rts
sta $01
; Transfer the bytes in the last page
-
+
ldy #$00
@L3: lda (ptr1),y
sta (ptr2),y
pla
sta $01 ; Restore the old configuration
cli
-
+
; Done
@L4: rts
;
-; Extended memory driver for the RamCart 64/128KB cartridge
-; (based on GEORAM code by Ullrich von Bassewitz)
+; Extended memory driver for the RamCart 64/128KB cartridge. Driver works
+; without problems when statically linked.
+; Code is based on GEORAM code by Ullrich von Bassewitz.
; Maciej 'YTM/Elysium' Witkowiak <ytm@elysium.pl>
; 06,22.12.2002
-;
+;
.include "zeropage.inc"
; Jump table.
.word INSTALL
- .word DEINSTALL
+ .word UNINSTALL
.word PAGECOUNT
.word MAP
.word USE
; ------------------------------------------------------------------------
; Data.
-.data
+.bss
-pagecount: .word 512 ; default for RC128
+pagecount: .res 2 ; Number of available pages
.code
rts
; ------------------------------------------------------------------------
-; DEINSTALL routine. Is called before the driver is removed from memory.
+; UNINSTALL routine. Is called before the driver is removed from memory.
; Can do cleanup or whatever. Must not return anything.
;
-DEINSTALL:
+UNINSTALL:
rts
; Jump table.
.word INSTALL
- .word DEINSTALL
+ .word UNINSTALL
.word PAGECOUNT
.word MAP
.word USE
; ------------------------------------------------------------------------
; Data.
-.data
+.bss
pagecount: .res 2 ; Number of pages available
-curpage: .word $FFFF ; Current page number (invalid)
+curpage: .res 2 ; Current page number
-.bss
window: .res 256 ; Memory "window"
reu_params: .word $0000 ; Host address, lo, hi
- .word $0000 ; Exp address, lo, hi
+ .word $0000 ; Exp address, lo, hi
.byte $00 ; Expansion bank no.
.word $0000 ; # bytes to move, lo, hi
- .byte $00 ; Interrupt mask reg.
- .byte $00 ; Adress control reg.
+ .byte $00 ; Interrupt mask reg.
+ .byte $00 ; Adress control reg.
.code
beq @L1
ldx #>(256*4) ; 256KB when size bit is set
@L1: stx pagecount+1
-
- lda #<EM_ERR_OK
- ldx #>EM_ERR_OK
+
+ ldx #$FF
+ stx curpage
+ stx curpage+1 ; Invalidate the current page
+ inx
+ txa ; X = A = EM_ERR_OK
rts
; No REU found
rts
; ------------------------------------------------------------------------
-; DEINSTALL routine. Is called before the driver is removed from memory.
+; UNINSTALL routine. Is called before the driver is removed from memory.
; Can do cleanup or whatever. Must not return anything.
;
-DEINSTALL:
+UNINSTALL:
rts
; Jump table.
.word INSTALL
- .word DEINSTALL
+ .word UNINSTALL
.word PAGECOUNT
.word MAP
.word USE
ldx #VDC_CSET
lda tmp1
- jsr vdcputreg ; restore 16/64k flag
- jmp @endok ; and leave default values for 16k
+ jsr vdcputreg ; restore 16/64k flag
+ jmp @endok ; and leave default values for 16k
@have64k:
- lda #<256
- ldx #>256
- sta pagecount
- stx pagecount+1
+ lda #<256
+ ldx #>256
+ sta pagecount
+ stx pagecount+1
@endok:
lda #<EM_ERR_OK
ldx #>EM_ERR_OK
jmp vdcsetsrcaddr
; ------------------------------------------------------------------------
-; DEINSTALL routine. Is called before the driver is removed from memory.
+; UNINSTALL routine. Is called before the driver is removed from memory.
; Can do cleanup or whatever. Must not return anything.
;
-DEINSTALL:
+UNINSTALL:
;on C128 restore font and clear the screen?
rts
jsr setup
beq @L2 ; Skip if no full pages
-; Copy full pages
+; Copy full pages
@L1: jsr transferin
inc ptr1+1
jsr setup
beq @L2 ; Skip if no full pages
-; Copy full pages
+; Copy full pages
@L1: jsr transferout
inc ptr1+1