remove TABs

This commit is contained in:
Christian Groessler
2013-06-25 00:48:43 +02:00
parent 1347947f0d
commit be880bd157

View File

@@ -9,38 +9,38 @@
; Christian Groessler, chris@groessler.org, 2013 ; Christian Groessler, chris@groessler.org, 2013
; ;
DEBUG = 1 DEBUG = 1
.if .defined(__ATARIXL__) .if .defined(__ATARIXL__)
.export sramprep .export sramprep
.import __SRPREP_LOAD__, __SRPREP_SIZE__ .import __SRPREP_LOAD__, __SRPREP_SIZE__
.import __SHADOW_RAM_LOAD__, __SHADOW_RAM_SIZE__ .import __SHADOW_RAM_LOAD__, __SHADOW_RAM_SIZE__
.import __SHADOW_RAM_RUN__ .import __SHADOW_RAM_RUN__
.import __CHARGEN_START__, __CHARGEN_SIZE__ .import __CHARGEN_START__, __CHARGEN_SIZE__
.import __SAVEAREA_LOAD__ .import __SAVEAREA_LOAD__
.import zpsave .import zpsave
.include "zeropage.inc" .include "zeropage.inc"
.include "atari.inc" .include "atari.inc"
.include "save_area.inc" .include "save_area.inc"
.macro print_string text .macro print_string text
.local start, cont .local start, cont
jmp cont jmp cont
start: .byte text, ATEOL start: .byte text, ATEOL
cont: ldx #0 ; channel 0 cont: ldx #0 ; channel 0
lda #<start lda #<start
sta ICBAL,x ; address sta ICBAL,x ; address
lda #>start lda #>start
sta ICBAH,x sta ICBAH,x
lda #<(cont - start) lda #<(cont - start)
sta ICBLL,x ; length sta ICBLL,x ; length
lda #>(cont - start) lda #>(cont - start)
sta ICBLH,x sta ICBLH,x
lda #PUTCHR lda #PUTCHR
sta ICCOM,x sta ICCOM,x
jsr CIOV_org jsr CIOV_org
.endmacro .endmacro
; ------------------------------------------------------------------------ ; ------------------------------------------------------------------------
@@ -58,71 +58,71 @@ cont: ldx #0 ; channel 0
sramprep: sramprep:
.ifdef DEBUG .ifdef DEBUG
print_string "entering stage #2" print_string "entering stage #2"
.endif .endif
; save values of modified system variables and ports ; save values of modified system variables and ports
lda RAMTOP lda RAMTOP
sta RAMTOP_save sta RAMTOP_save
lda MEMTOP lda MEMTOP
sta MEMTOP_save sta MEMTOP_save
lda MEMTOP+1 lda MEMTOP+1
sta MEMTOP_save+1 sta MEMTOP_save+1
lda APPMHI lda APPMHI
sta APPMHI_save sta APPMHI_save
lda APPMHI+1 lda APPMHI+1
sta APPMHI_save+1 sta APPMHI_save+1
lda PORTB lda PORTB
sta PORTB_save sta PORTB_save
lda CIOV ; zero-page wrapper lda CIOV ; zero-page wrapper
sta ZP_CIOV_save sta ZP_CIOV_save
lda CIOV+1 lda CIOV+1
sta ZP_CIOV_save+1 sta ZP_CIOV_save+1
lda CIOV+2 lda CIOV+2
sta ZP_CIOV_save+2 sta ZP_CIOV_save+2
lda SIOV ; zero-page wrapper lda SIOV ; zero-page wrapper
sta ZP_SIOV_save sta ZP_SIOV_save
lda SIOV+1 lda SIOV+1
sta ZP_SIOV_save+1 sta ZP_SIOV_save+1
lda SIOV+2 lda SIOV+2
sta ZP_SIOV_save+2 sta ZP_SIOV_save+2
lda $fffe lda $fffe
sta IRQ_save sta IRQ_save
lda $ffff lda $ffff
sta IRQ_save+1 sta IRQ_save+1
lda $fffc lda $fffc
sta RESET_save sta RESET_save
lda $fffd lda $fffd
sta RESET_save+1 sta RESET_save+1
lda $fffa lda $fffa
sta NMI_save sta NMI_save
lda $fffb lda $fffb
sta NMI_save+1 sta NMI_save+1
; disable BASIC ; disable BASIC
lda PORTB lda PORTB
ora #2 ora #2
sta PORTB sta PORTB
.include "xlmemchk.inc" ; calculate lowest address used and new value for RAMTOP .include "xlmemchk.inc" ; calculate lowest address used and new value for RAMTOP
ldx lowadr ldx lowadr
stx MEMTOP stx MEMTOP
stx APPMHI stx APPMHI
lda lowadr+1 lda lowadr+1
sta MEMTOP+1 sta MEMTOP+1
sta APPMHI+1 sta APPMHI+1
lda lodadr+1 lda lodadr+1
sta RAMTOP sta RAMTOP
; ... issue a GRAPHICS 0 call (copied'n'pasted from TGI drivers) ; ... issue a GRAPHICS 0 call (copied'n'pasted from TGI drivers)
ldx #$50 ; take any IOCB, hopefully free (@@@ fixme) ldx #$50 ; take any IOCB, hopefully free (@@@ fixme)
; Reopen it in Graphics 0 ; Reopen it in Graphics 0
lda #OPEN lda #OPEN
@@ -140,14 +140,14 @@ sramprep:
lda #>screen_device_length lda #>screen_device_length
sta ICBLH,x sta ICBLH,x
jsr CIOV_org jsr CIOV_org
bpl okoko bpl okoko
print_string "Internal error, aborting..." print_string "Internal error, aborting..."
jsr delay jsr delay
jsr delay jsr delay
jsr delay jsr delay
jmp (DOSVEC) ; abort loading jmp (DOSVEC) ; abort loading
okoko: okoko:
@@ -170,99 +170,99 @@ L1: lda sp,x
; copy chargen to low memory ; copy chargen to low memory
.ifdef DEBUG .ifdef DEBUG
print_string "copy chargen to low memory" print_string "copy chargen to low memory"
print_string "set up high memory" print_string "set up high memory"
.endif .endif
lda #>(__SRPREP_LOAD__ + __SRPREP_SIZE__ + __SHADOW_RAM_SIZE__) lda #>(__SRPREP_LOAD__ + __SRPREP_SIZE__ + __SHADOW_RAM_SIZE__)
sta ptr3+1 sta ptr3+1
lda #<(__SRPREP_LOAD__ + __SRPREP_SIZE__ + __SHADOW_RAM_SIZE__) lda #<(__SRPREP_LOAD__ + __SRPREP_SIZE__ + __SHADOW_RAM_SIZE__)
sta ptr3 sta ptr3
beq cg_addr_ok beq cg_addr_ok
; page align the new chargen address ; page align the new chargen address
inc ptr3+1 inc ptr3+1
lda #0 lda #0
sta ptr3 sta ptr3
cg_addr_ok: cg_addr_ok:
lda #<DCSORG lda #<DCSORG
sta ptr1 sta ptr1
lda #>DCSORG lda #>DCSORG
sta ptr1+1 sta ptr1+1
lda ptr3 lda ptr3
sta ptr2 sta ptr2
lda ptr3+1 lda ptr3+1
sta ptr2+1 sta ptr2+1
lda #>__CHARGEN_SIZE__ lda #>__CHARGEN_SIZE__
sta tmp2 sta tmp2
lda #<__CHARGEN_SIZE__ lda #<__CHARGEN_SIZE__
sta tmp2+1 sta tmp2+1
jsr memcopy jsr memcopy
; TODO: switch to this temp. chargen ; TODO: switch to this temp. chargen
; disable ROMs ; disable ROMs
sei sei
ldx #0 ldx #0
stx NMIEN ; disable NMI stx NMIEN ; disable NMI
lda PORTB lda PORTB
and #$fe and #$fe
sta PORTB ; now ROM is mapped out sta PORTB ; now ROM is mapped out
; copy shadow RAM contents to their destination ; copy shadow RAM contents to their destination
lda #<__SHADOW_RAM_SIZE__ lda #<__SHADOW_RAM_SIZE__
bne do_copy bne do_copy
lda #>__SHADOW_RAM_SIZE__ lda #>__SHADOW_RAM_SIZE__
beq no_copy ; we have no shadow RAM contents beq no_copy ; we have no shadow RAM contents
; ptr1 - src; ptr2 - dest; tmp1, tmp2 - len ; ptr1 - src; ptr2 - dest; tmp1, tmp2 - len
do_copy:lda #<__SHADOW_RAM_LOAD__ do_copy:lda #<__SHADOW_RAM_LOAD__
sta ptr1 sta ptr1
lda #>__SHADOW_RAM_LOAD__ lda #>__SHADOW_RAM_LOAD__
sta ptr1+1 sta ptr1+1
lda #<__SHADOW_RAM_RUN__ lda #<__SHADOW_RAM_RUN__
sta ptr2 sta ptr2
lda #>__SHADOW_RAM_RUN__ lda #>__SHADOW_RAM_RUN__
sta ptr2+1 sta ptr2+1
lda #<__SHADOW_RAM_SIZE__ lda #<__SHADOW_RAM_SIZE__
sta tmp1 sta tmp1
lda #>__SHADOW_RAM_SIZE__ lda #>__SHADOW_RAM_SIZE__
sta tmp2 sta tmp2
jsr memcopy jsr memcopy
no_copy: no_copy:
; copy chargen to its new (final) location ; copy chargen to its new (final) location
lda ptr3 lda ptr3
sta ptr1 sta ptr1
lda ptr3+1 lda ptr3+1
sta ptr1+1 sta ptr1+1
lda #<__CHARGEN_START__ lda #<__CHARGEN_START__
sta ptr2 sta ptr2
lda #>__CHARGEN_START__ lda #>__CHARGEN_START__
sta ptr2+1 sta ptr2+1
lda #>__CHARGEN_SIZE__ lda #>__CHARGEN_SIZE__
sta tmp2 sta tmp2
lda #<__CHARGEN_SIZE__ lda #<__CHARGEN_SIZE__
sta tmp1 sta tmp1
jsr memcopy jsr memcopy
; re-enable ROM ; re-enable ROM
lda PORTB lda PORTB
ora #1 ora #1
sta PORTB sta PORTB
lda #$40 lda #$40
sta NMIEN ; enable VB again sta NMIEN ; enable VB again
cli ; and enable IRQs cli ; and enable IRQs
.ifdef DEBUG .ifdef DEBUG
print_string "Stage #2 OK" print_string "Stage #2 OK"
jsr delay jsr delay
.endif .endif
rts rts
@@ -274,26 +274,26 @@ no_copy:
; ptr2 - destination ; ptr2 - destination
; tmp2:tmp1 - len ; tmp2:tmp1 - len
.proc memcopy .proc memcopy
ldy #0 ldy #0
ldx tmp2 ldx tmp2
beq last beq last
pagecp: lda (ptr1),y pagecp: lda (ptr1),y
sta (ptr2),y sta (ptr2),y
iny iny
bne pagecp bne pagecp
inc ptr1+1 inc ptr1+1
inc ptr2+1 inc ptr2+1
dex dex
bne pagecp bne pagecp
last: cpy tmp1 last: cpy tmp1
beq done beq done
lda (ptr1),y lda (ptr1),y
sta (ptr2),y sta (ptr2),y
iny iny
bne last bne last
done: rts done: rts
.endproc .endproc
@@ -301,32 +301,32 @@ done: rts
.byte "HERE ****************** HERE ***************>>>>>>" .byte "HERE ****************** HERE ***************>>>>>>"
sramsize: sramsize:
.word __SHADOW_RAM_SIZE__ .word __SHADOW_RAM_SIZE__
; short delay ; short delay
.proc delay .proc delay
lda #10 lda #10
l: jsr delay1 l: jsr delay1
clc clc
sbc #0 sbc #0
bne l bne l
rts rts
delay1: ldx #0 delay1: ldx #0
ldy #0 ldy #0
loop: dey loop: dey
bne loop bne loop
dex dex
bne loop bne loop
rts rts
.endproc .endproc
screen_device: .byte "S:",0 screen_device: .byte "S:",0
screen_device_length = * - screen_device screen_device_length = * - screen_device
.byte " ** srprep ** end-->" .byte " ** srprep ** end-->"
; ------------------------------------------------------------------------ ; ------------------------------------------------------------------------
; Provide an empty SHADOW_RAM segment in order that the linker is happy ; Provide an empty SHADOW_RAM segment in order that the linker is happy
@@ -344,4 +344,4 @@ screen_device_length = * - screen_device
.word INITAD+1 .word INITAD+1
.word __SRPREP_LOAD__ .word __SRPREP_LOAD__
.endif ; .if .defined(__ATARIXL__) .endif ; .if .defined(__ATARIXL__)