some cleanup
This commit is contained in:
@@ -3,19 +3,22 @@
|
|||||||
;should work for ActionReplay as well...
|
;should work for ActionReplay as well...
|
||||||
;
|
;
|
||||||
;
|
;
|
||||||
;Version 1.0
|
; original Version 1.0 by Johannes Braun 2006-08-22 <hannenz@freenet.de>
|
||||||
;
|
|
||||||
;Johannes Braun 2006-08-22
|
|
||||||
;hannenz@freenet.de
|
|
||||||
;
|
;
|
||||||
;use the functions described in "usr/lib/cc65/include/em.h" to make use of this driver.
|
;use the functions described in "usr/lib/cc65/include/em.h" to make use of this driver.
|
||||||
;-------------------------------------------------------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
|
|
||||||
;NOTE: If called from ROM the Lo_Code routines must exit with LDA #$00 / STA $DE00!!! just change and recompile!
|
;NOTE: If called from ROM the Lo_Code routines must exit with LDA #$00 / STA $DE00!!! just change and recompile!
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
|
|
||||||
.include "em-kernel.inc"
|
.include "em-kernel.inc"
|
||||||
.importzp ptr1,ptr2,ptr3,ptr4,tmp1
|
.include "em-error.inc"
|
||||||
|
|
||||||
.macpack generic
|
.macpack generic
|
||||||
|
.macpack module
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------
|
||||||
|
|
||||||
c64_ram = ptr1 ; use some more expressive identifiers...
|
c64_ram = ptr1 ; use some more expressive identifiers...
|
||||||
rr_ram = ptr2
|
rr_ram = ptr2
|
||||||
@@ -25,12 +28,23 @@ temp = tmp1
|
|||||||
|
|
||||||
Lo_Mem = $0100 ; location of Lo_Code (must be below $1000 or above $e000)
|
Lo_Mem = $0100 ; location of Lo_Code (must be below $1000 or above $e000)
|
||||||
|
|
||||||
.segment "JUMPTABLE"
|
; ------------------------------------------------------------------------
|
||||||
|
; Header. Includes jump table
|
||||||
|
|
||||||
.byte $65,$6d,$64 ;Driver signature
|
module_header _c64_rrr_emd
|
||||||
.byte EMD_API_VERSION
|
|
||||||
|
|
||||||
.addr INSTALL ;Jump Table
|
; Driver signature
|
||||||
|
|
||||||
|
.byte $65, $6d, $64 ; "emd"
|
||||||
|
.byte EMD_API_VERSION ; EM API version number
|
||||||
|
|
||||||
|
; Library reference
|
||||||
|
|
||||||
|
.addr $0000
|
||||||
|
|
||||||
|
; Jump table
|
||||||
|
|
||||||
|
.addr INSTALL
|
||||||
.addr UNINSTALL
|
.addr UNINSTALL
|
||||||
.addr PAGECOUNT
|
.addr PAGECOUNT
|
||||||
.addr MAP
|
.addr MAP
|
||||||
@@ -39,13 +53,17 @@ Lo_Mem = $0100 ;location of Lo_Code (must be below $1000 or above
|
|||||||
.addr COPYFROM
|
.addr COPYFROM
|
||||||
.addr COPYTO
|
.addr COPYTO
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
window: .res 256 ; the memory window (256 bytes)
|
window: .res 256 ; the memory window (256 bytes)
|
||||||
|
|
||||||
.rodata
|
.rodata
|
||||||
dummy: .word window ;a "pseudo"-em_copy_struct, used by em_map/ em_commit
|
dummy:
|
||||||
|
.word window ; a "pseudo"-em_copy_struct, used by em_map/ em_commit
|
||||||
.byte 0 ; to pass over to COPYTO/COPYFROM
|
.byte 0 ; to pass over to COPYTO/COPYFROM
|
||||||
curpage: .byte $ff ;just this byte is changed according to the desired page
|
curpage:
|
||||||
|
.byte $ff ; just this byte is changed according to the desired page
|
||||||
.byte 0
|
.byte 0
|
||||||
.word 256
|
.word 256
|
||||||
|
|
||||||
@@ -100,7 +118,7 @@ c1: stx $de00 ;try accessing rr-ram
|
|||||||
bne no
|
bne no
|
||||||
lda #0
|
lda #0
|
||||||
rts
|
rts
|
||||||
no: asl ;.A still has #2, so return #4: error code for "device not present"
|
no: asl ; A still has #2, so return #4: error code for "device not present"
|
||||||
rts
|
rts
|
||||||
c2:
|
c2:
|
||||||
;----------------------------------------------------------------------------------------
|
;----------------------------------------------------------------------------------------
|
||||||
@@ -109,6 +127,7 @@ c2:
|
|||||||
UNINSTALL:
|
UNINSTALL:
|
||||||
return_null:
|
return_null:
|
||||||
lda #$00 ; always return 32kb (128 pages)
|
lda #$00 ; always return 32kb (128 pages)
|
||||||
|
; fall through, skip the LDA
|
||||||
.byte $2c
|
.byte $2c
|
||||||
|
|
||||||
;----------------------------------------------------------------------------------------
|
;----------------------------------------------------------------------------------------
|
||||||
@@ -126,7 +145,8 @@ USE:
|
|||||||
cmp #$80 ; valid page?
|
cmp #$80 ; valid page?
|
||||||
bcs return_null ; no, return NULL pointer
|
bcs return_null ; no, return NULL pointer
|
||||||
sta curpage ; set to current page
|
sta curpage ; set to current page
|
||||||
return_win: lda #<window ;return pointer to window
|
return_win:
|
||||||
|
lda #<window ; return pointer to window
|
||||||
ldx #>window
|
ldx #>window
|
||||||
return: rts
|
return: rts
|
||||||
|
|
||||||
@@ -281,5 +301,6 @@ get_struct_data:
|
|||||||
lda (aux),y ;length hi-byte
|
lda (aux),y ;length hi-byte
|
||||||
adc c64_ram+1
|
adc c64_ram+1
|
||||||
sta len+1 ;tmp2: length, tmp3 contains end adress of transfer in c64-ram.
|
sta len+1 ;tmp2: length, tmp3 contains end adress of transfer in c64-ram.
|
||||||
rts ;55 bytes
|
rts
|
||||||
|
;55 bytes
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user