mirror of
https://github.com/uffejakobsen/acme.git
synced 2025-01-05 17:29:19 +00:00
reformatted example sources (some slightly, some not so slightly).
git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@12 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
parent
a80d24565b
commit
0ec58e8b15
354
examples/ddrv.a
354
examples/ddrv.a
@ -25,6 +25,7 @@
|
||||
; (which were included in GO64 magazine 8/1999)
|
||||
; 26 Mar 2006 Release 4.03. Adjusted source to ACME 0.91 capabilities.
|
||||
; 25 Nov 2007 Release 4.04. Adjusted source to ACME 0.94 capabilities.
|
||||
; 7 Apr 2013 Slightly reformatted.
|
||||
|
||||
; This source code file uses conditional assembly
|
||||
; to decide which version to produce (C64 or C128).
|
||||
@ -44,26 +45,26 @@
|
||||
; Start address, output file name and VIC location
|
||||
|
||||
!if SYSTEM = 64 {
|
||||
*=$c000
|
||||
* = $c000
|
||||
!to "ddrv64.prg", cbm
|
||||
VIC_Base = $d000
|
||||
}
|
||||
!if SYSTEM = 128 {
|
||||
*=$0c00
|
||||
* = $0c00
|
||||
!to "ddrv128.prg", cbm
|
||||
VIC_Base = $11d6; Location of mirror registers
|
||||
VIC_Base = $11d6 ; Location of mirror registers
|
||||
}
|
||||
|
||||
; Pointer's maximum coordinates
|
||||
MaximumCoordinateX = 319; VIC value
|
||||
; MaximumCoordinateX = 639; VDC value
|
||||
MaximumCoordinateX = 319 ; VIC value
|
||||
; MaximumCoordinateX = 639 ; VDC value
|
||||
MaximumCoordinateY = 199
|
||||
|
||||
; Maximum pixel step size ("speed") for joystick acceleration routine.
|
||||
MaxStep = $10; (max. $7f)
|
||||
MaxStep = $10 ; max $7f
|
||||
|
||||
; Distance before acceleration starts, in pixels.
|
||||
MaxTime = $04; (max. $7f)
|
||||
MaxTime = $04 ; max $7f
|
||||
|
||||
; Sprites to use for overlay pointer
|
||||
Sprite_A = 0
|
||||
@ -93,7 +94,7 @@
|
||||
; Location to store pointer's current pixel coordinates. The driver
|
||||
; code relies on having *four consecutive* bytes:
|
||||
; x low, x high, y low, y high
|
||||
Coordinates = $fb; $fb-$fe
|
||||
Coordinates = $fb ; $fb..$fe
|
||||
|
||||
|
||||
; --- System constants
|
||||
@ -106,7 +107,7 @@
|
||||
cia1_pra = $dc00
|
||||
cia1_prb = $dc01
|
||||
cia1_ddrb = $dc03
|
||||
mmu_cr = $ff00; c128 only
|
||||
mmu_cr = $ff00 ; c128 only
|
||||
|
||||
|
||||
; --- Label definitions
|
||||
@ -115,17 +116,17 @@
|
||||
; readability. Don't change these.
|
||||
PointerXnow = Coordinates
|
||||
PointerYnow = Coordinates + 2
|
||||
SpriteA_X = VIC_Base + 2*Sprite_A
|
||||
SpriteA_Y = VIC_Base + 2*Sprite_A + 1
|
||||
SpriteB_X = VIC_Base + 2*Sprite_B
|
||||
SpriteB_Y = VIC_Base + 2*Sprite_B + 1
|
||||
Sprites_OF = VIC_Base + 16; X Overflow
|
||||
SpriteA_X = VIC_Base + 2 * Sprite_A
|
||||
SpriteA_Y = VIC_Base + 2 * Sprite_A + 1
|
||||
SpriteB_X = VIC_Base + 2 * Sprite_B
|
||||
SpriteB_Y = VIC_Base + 2 * Sprite_B + 1
|
||||
Sprites_OF = VIC_Base + 16 ; X Overflow
|
||||
; The character "^" in the following calculation means "to the power
|
||||
; of". It is ACME syntax - if your assembler cannot do this, you may
|
||||
; want to use hardcoded values here instead of calculations.
|
||||
Sprites_Bitmask = 2^Sprite_A + 2^Sprite_B
|
||||
Sprites_Bitmask = 2 ^ Sprite_A + 2 ^ Sprite_B
|
||||
;alternative:
|
||||
; Sprites_Bitmask = 1<<Sprite_A | 1<<Sprite_B
|
||||
; Sprites_Bitmask = 1 << Sprite_A | 1 << Sprite_B
|
||||
SpriteOffset_X = $18 - Sprite_HotspotX
|
||||
SpriteOffset_Y = $32 - Sprite_HotspotY
|
||||
; In the sprite coordinate system, the graphics pixel (0,0) has the
|
||||
@ -139,45 +140,46 @@
|
||||
; Initialisation code, installs driver on IRQ vector.
|
||||
; Fetch IRQ vector and write to end
|
||||
Init lda sys_iirq
|
||||
ldx sys_iirq+1
|
||||
ldx sys_iirq + 1
|
||||
sta mod16
|
||||
stx mod16+1
|
||||
stx mod16 + 1
|
||||
; Let IRQ vector point to driver code
|
||||
lda #<Entry
|
||||
ldx #>Entry
|
||||
php
|
||||
sei
|
||||
sta sys_iirq
|
||||
stx sys_iirq+1
|
||||
stx sys_iirq + 1
|
||||
plp
|
||||
!if SYSTEM=128 {
|
||||
!if SYSTEM = 128 {
|
||||
lda mmu_cr
|
||||
tay
|
||||
and #$fe; activate I/O chips
|
||||
and #$fe ; activate I/O chips
|
||||
sta mmu_cr
|
||||
}
|
||||
|
||||
; Init mouse buttons
|
||||
lda #$11
|
||||
sta cia1_prb
|
||||
!if SYSTEM=128 {sty mmu_cr }
|
||||
|
||||
!if SYSTEM = 128 {
|
||||
sty mmu_cr
|
||||
}
|
||||
!if SYSTEM = 64 {
|
||||
; Copy sprites to tape buffer
|
||||
ldx #127
|
||||
- lda Sprites,x
|
||||
sta $0340,x
|
||||
- lda Sprites, x
|
||||
sta $0340, x
|
||||
dex
|
||||
bpl -
|
||||
lda #Sprites_Bitmask
|
||||
; Set sprite block pointers
|
||||
ldx #$0d
|
||||
stx 2040+Sprite_A
|
||||
stx 2040 + Sprite_A
|
||||
inx
|
||||
stx 2040+Sprite_B
|
||||
stx 2040 + Sprite_B
|
||||
; Activate pointer sprites
|
||||
ora VIC_Base+21
|
||||
sta VIC_Base+21
|
||||
ora VIC_Base + 21
|
||||
sta VIC_Base + 21
|
||||
}
|
||||
rts
|
||||
|
||||
@ -210,17 +212,17 @@ Entry
|
||||
; --- Part 1, handling mouse movements
|
||||
|
||||
; mouse x
|
||||
ldx #$00; 0 means "x stuff"
|
||||
ldx #$00 ; 0 means "x stuff"
|
||||
jsr PotDelta
|
||||
; Now signed x movement is in A/Y. Add to current x value.
|
||||
clc
|
||||
adc PointerXnow
|
||||
sta PointerXnow
|
||||
tya
|
||||
adc PointerXnow+1
|
||||
sta PointerXnow+1
|
||||
adc PointerXnow + 1
|
||||
sta PointerXnow + 1
|
||||
; mouse y
|
||||
ldx #$01; 1 means "y stuff"
|
||||
ldx #$01 ; 1 means "y stuff"
|
||||
jsr PotDelta
|
||||
; Now signed y movement is in A/Y. Mouse and computer use different y
|
||||
; directions, so don't add to, but subtract from current y value.
|
||||
@ -231,9 +233,9 @@ Entry
|
||||
eor #$ff
|
||||
sta PointerYnow
|
||||
tya
|
||||
sbc PointerYnow+1
|
||||
sbc PointerYnow + 1
|
||||
eor #$ff
|
||||
sta PointerYnow+1
|
||||
sta PointerYnow + 1
|
||||
|
||||
|
||||
; --- Part 2, handling mouse buttons
|
||||
@ -241,17 +243,18 @@ Entry
|
||||
; Prepare CIA by setting bits to input
|
||||
ldy #$11
|
||||
sty cia1_ddrb
|
||||
ldx #$ff; $ff means "pressed"
|
||||
lda #$10; check left button
|
||||
ldx #$ff ; $ff means "pressed"
|
||||
lda #$10 ; check left button
|
||||
bit cia1_prb
|
||||
bne +
|
||||
stx LeftButton; store state
|
||||
+ lda #$01; check right button
|
||||
stx LeftButton ; store state
|
||||
+ lda #$01 ; check right button
|
||||
bit cia1_prb
|
||||
bne +
|
||||
stx RightButton; store state
|
||||
stx RightButton ; store state
|
||||
+
|
||||
; Reset CIA to normal state
|
||||
+ ldy #$00
|
||||
ldy #$00
|
||||
sty cia1_ddrb
|
||||
|
||||
|
||||
@ -259,63 +262,63 @@ Entry
|
||||
|
||||
; Fetch byte holding direction flags
|
||||
lda cia1_pra
|
||||
tax; ...and remember it
|
||||
tax ; ...and remember it
|
||||
; Check 'up' direction
|
||||
ror
|
||||
bcs ++
|
||||
; Subtract current step size from y value if needed.
|
||||
tay
|
||||
sec
|
||||
lda PointerYnow
|
||||
sbc JoyStepsize
|
||||
sta PointerYnow
|
||||
bcs +
|
||||
dec PointerYnow+1
|
||||
+ tya
|
||||
; Check 'down' direction
|
||||
++ ror
|
||||
; Subtract current step size from y value if needed.
|
||||
tay
|
||||
sec
|
||||
lda PointerYnow
|
||||
sbc JoyStepsize
|
||||
sta PointerYnow
|
||||
bcs +
|
||||
dec PointerYnow + 1
|
||||
+ tya
|
||||
++ ; Check 'down' direction
|
||||
ror
|
||||
bcs ++
|
||||
; Add current step size to y value if needed.
|
||||
tay
|
||||
;clc; C is always clear here
|
||||
lda PointerYnow
|
||||
adc JoyStepsize
|
||||
sta PointerYnow
|
||||
bcc +
|
||||
inc PointerYnow+1
|
||||
+ tya
|
||||
; Check 'left' direction
|
||||
++ ror
|
||||
; Add current step size to y value if needed.
|
||||
tay
|
||||
;clc ; C is always clear here
|
||||
lda PointerYnow
|
||||
adc JoyStepsize
|
||||
sta PointerYnow
|
||||
bcc +
|
||||
inc PointerYnow + 1
|
||||
+ tya
|
||||
++ ; Check 'left' direction
|
||||
ror
|
||||
bcs ++
|
||||
; Subtract current step size from x value if needed.
|
||||
tay
|
||||
sec
|
||||
lda PointerXnow
|
||||
sbc JoyStepsize
|
||||
sta PointerXnow
|
||||
bcs +
|
||||
dec PointerXnow+1
|
||||
+ tya
|
||||
; Check 'right' direction
|
||||
++ ror
|
||||
; Subtract current step size from x value if needed.
|
||||
tay
|
||||
sec
|
||||
lda PointerXnow
|
||||
sbc JoyStepsize
|
||||
sta PointerXnow
|
||||
bcs +
|
||||
dec PointerXnow + 1
|
||||
+ tya
|
||||
++ ; Check 'right' direction
|
||||
ror
|
||||
bcs ++
|
||||
; Add current step size to x value if needed.
|
||||
tay
|
||||
;clc; C is always clear here
|
||||
lda PointerXnow
|
||||
adc JoyStepsize
|
||||
sta PointerXnow
|
||||
bcc +
|
||||
inc PointerXnow+1
|
||||
+ tya
|
||||
; Add current step size to x value if needed.
|
||||
tay
|
||||
;clc ; C is always clear here
|
||||
lda PointerXnow
|
||||
adc JoyStepsize
|
||||
sta PointerXnow
|
||||
bcc +
|
||||
inc PointerXnow + 1
|
||||
+ tya
|
||||
++
|
||||
|
||||
; --- Part 4, handling joystick button
|
||||
|
||||
ror
|
||||
bcs +
|
||||
lda #$ff; $ff means "pressed"
|
||||
sta LeftButton
|
||||
lda #$ff ; $ff means "pressed"
|
||||
sta LeftButton
|
||||
+
|
||||
|
||||
; --- Part 5, joystick acceleration
|
||||
@ -323,42 +326,42 @@ Entry
|
||||
; Restore joystick direction bits and check whether to set speed to
|
||||
; zero.
|
||||
txa
|
||||
and #$0f; Clear unneeded bits
|
||||
cmp #$0f; Any direction bit ?
|
||||
and #$0f ; Clear unneeded bits
|
||||
cmp #$0f ; Any direction bit ?
|
||||
bne +
|
||||
; No direction was used, so reset speed and wait counter to normal.
|
||||
lda #$01
|
||||
sta JoyStepsize
|
||||
lda #MaxTime
|
||||
sta JoyWaittime
|
||||
jmp Part5End
|
||||
lda #$01
|
||||
sta JoyStepsize
|
||||
lda #MaxTime
|
||||
sta JoyWaittime
|
||||
jmp Part5End
|
||||
+
|
||||
; A direction bit was used, so check whether to accelerate: If speed
|
||||
; is already maximum speed, don't accelerate.
|
||||
JoyStepsize=*+1
|
||||
lda #$00; (self-modifying)
|
||||
JoyStepsize = * + 1
|
||||
lda #$00 ; (self-modifying)
|
||||
; If the variable "JoyStepsize" would have been defined as a separate
|
||||
; location (using "!byte"), it would have taken a byte of memory. By
|
||||
; storing the value inside an LDA command's argument, we save that one
|
||||
; byte. It might make a difference. :)
|
||||
cmp #MaxStep; If speed is max.,
|
||||
bcs Part5End; don't accelerate.
|
||||
; Speed isn't maximum yet. Check whether
|
||||
; we have to wait before accelerating.
|
||||
dec JoyWaittime
|
||||
bpl Part5End
|
||||
; Counter has underrun, so accelerate.
|
||||
inc JoyWaittime; reset counter
|
||||
inc JoyStepsize; increase speed
|
||||
cmp #MaxStep ; If speed is max.,
|
||||
bcs Part5End ; don't accelerate.
|
||||
; Speed isn't maximum yet. Check whether
|
||||
; we have to wait before accelerating.
|
||||
dec JoyWaittime
|
||||
bpl Part5End
|
||||
; Counter has underrun, so accelerate.
|
||||
inc JoyWaittime ; reset counter
|
||||
inc JoyStepsize ; increase speed
|
||||
Part5End
|
||||
|
||||
; --- Part 6, restrict coordinate range
|
||||
|
||||
; restrict x value
|
||||
ldx #$00; 0 means "x stuff"
|
||||
ldx #$00 ; 0 means "x stuff"
|
||||
jsr Restrict
|
||||
; restrict y value
|
||||
ldx #$02; 2 means "y stuff"
|
||||
ldx #$02 ; 2 means "y stuff"
|
||||
jsr Restrict
|
||||
|
||||
; --- Part 7, positioning sprites
|
||||
@ -367,16 +370,16 @@ Part5End
|
||||
lda PointerXnow
|
||||
clc
|
||||
adc #SpriteOffset_X
|
||||
sta SpriteA_X; set both sprites
|
||||
sta SpriteA_X ; set both sprites
|
||||
sta SpriteB_X
|
||||
lda Sprites_OF; get x overflow
|
||||
lda Sprites_OF ; get x overflow
|
||||
bcs SetOF
|
||||
ldx PointerXnow+1
|
||||
ldx PointerXnow + 1
|
||||
bne SetOF
|
||||
and #Sprites_Bitmask XOR $ff
|
||||
bcc StoreOF; C is clear here
|
||||
bcc StoreOF ; C is clear here
|
||||
SetOF ora #Sprites_Bitmask
|
||||
StoreOF sta Sprites_OF; set x overflow
|
||||
StoreOF sta Sprites_OF ; set x overflow
|
||||
|
||||
; Set sprites' y positions
|
||||
lda PointerYnow
|
||||
@ -394,10 +397,10 @@ StoreOF sta Sprites_OF; set x overflow
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
ldx PointerXnow+1
|
||||
;ora OrTable,x; VDC only (see below for data table)
|
||||
beq +; VIC only
|
||||
ora #$20; VIC only
|
||||
ldx PointerXnow + 1
|
||||
;ora OrTable,x ; VDC only (see below for data table)
|
||||
beq + ; VIC only
|
||||
ora #$20 ; VIC only
|
||||
+ sta CharX
|
||||
|
||||
; Convert y coordinate.
|
||||
@ -416,10 +419,10 @@ StoreOF sta Sprites_OF; set x overflow
|
||||
|
||||
; The initialisation routine sets the argument to the address of the
|
||||
; previous IRQ routine.
|
||||
mod16=*+1: jmp $ffff; (self-modifying)
|
||||
mod16 = * + 1: jmp $ffff ; (self-modifying)
|
||||
|
||||
; This table is for part 8.
|
||||
;OrTable !byte 0,32,64; VDC only
|
||||
;OrTable !byte 0, 32, 64 ; VDC only
|
||||
|
||||
; --- "Restrict" subroutine
|
||||
|
||||
@ -430,21 +433,22 @@ PointerYmax !word MaximumCoordinateY
|
||||
Restrict
|
||||
; Restrict internal coordinates to configured range. Entry conditions:
|
||||
; X is direction handle (0 = x, 2 = y)
|
||||
lda PointerXnow+1,x
|
||||
lda PointerXnow + 1, x
|
||||
bmi SetTo0
|
||||
cmp PointerXmax+1,x
|
||||
cmp PointerXmax + 1, x
|
||||
bcc Eosr
|
||||
bne +
|
||||
lda PointerXmax,x
|
||||
cmp PointerXnow,x
|
||||
bcs Eosr
|
||||
+ lda PointerXmax,x
|
||||
ldy PointerXmax+1,x
|
||||
lda PointerXmax, x
|
||||
cmp PointerXnow, x
|
||||
bcs Eosr
|
||||
+ lda PointerXmax, x
|
||||
ldy PointerXmax + 1, x
|
||||
jmp DefCo
|
||||
|
||||
SetTo0 lda #0
|
||||
tay
|
||||
DefCo sta PointerXnow,x
|
||||
sty PointerXnow+1,x
|
||||
DefCo sta PointerXnow, x
|
||||
sty PointerXnow + 1, x
|
||||
Eosr rts
|
||||
|
||||
; --- "Pot" subroutine
|
||||
@ -452,11 +456,11 @@ Eosr rts
|
||||
; This routine computes the mouse movements and therefore contains the
|
||||
; self-calibration stuff and the other improvements over the standard
|
||||
; 1351 driver.
|
||||
PotMax !word 0; max. POTs yet plus 1 !
|
||||
PotMin !word $ffff; lowest POTs yet
|
||||
PotOld !word 0; old values
|
||||
PotWidth !word 0; interval width
|
||||
HalfPotWidth !word 0; half width
|
||||
PotMax !word 0 ; max. POTs yet plus 1 !
|
||||
PotMin !word $ffff ; lowest POTs yet
|
||||
PotOld !word 0 ; old values
|
||||
PotWidth !word 0 ; interval width
|
||||
HalfPotWidth !word 0 ; half width
|
||||
; (buffered for speed increase)
|
||||
; The above variables are not really words: The first byte is the x
|
||||
; value, the second byte is the y value respectively.
|
||||
@ -467,79 +471,79 @@ HalfPotWidth !word 0; half width
|
||||
; Exit conditions: A/Y are signed distance (low/high)
|
||||
|
||||
; First, get new value and clear "recalculate signal width" flag.
|
||||
PotDelta lda sid_pot,x
|
||||
PotDelta lda sid_pot, x
|
||||
ldy #$00
|
||||
; Check whether new value is lower than lowest known.
|
||||
cmp PotMin,x
|
||||
cmp PotMin, x
|
||||
bcs +
|
||||
; Store new "lowest" und set "recalculate signal width" flag.
|
||||
sta PotMin,x
|
||||
ldy #$ff
|
||||
; Store new "lowest" und set "recalculate signal width" flag.
|
||||
sta PotMin, x
|
||||
ldy #$ff
|
||||
+ ; Check whether new value is higher than highest known.
|
||||
cmp PotMax,x
|
||||
cmp PotMax, x
|
||||
bcc +
|
||||
; Set "recalculate signal width" flag and store new "highest".
|
||||
ldy #$ff
|
||||
pha; Remember current value
|
||||
adc #$00; Add one (C is set)
|
||||
sta PotMax,x
|
||||
ldy #$ff
|
||||
pha ; Remember current value
|
||||
adc #$00 ; Add one (C is set)
|
||||
sta PotMax, x
|
||||
; Value $ff (0 after adding) means that there is no mouse connected,
|
||||
; so reset min/max in that case.
|
||||
beq ResetMM; Stack is untidy...
|
||||
pla; Restore current value
|
||||
beq ResetMM ; Stack is untidy...
|
||||
pla ; Restore current value
|
||||
+ ; If flag is set, recalculate signal width.
|
||||
iny; Check flag
|
||||
iny ; Check flag
|
||||
bne ++
|
||||
tay; Buffer current value.
|
||||
lda PotMax,x; Get highest+1
|
||||
sec; Subtract lowest
|
||||
sbc PotMin,x
|
||||
bcc +
|
||||
sta PotWidth,x; Store signal
|
||||
lsr; width and half signal
|
||||
sta HalfPotWidth,x; width
|
||||
+ tya; Restore current value.
|
||||
tay ; Buffer current value.
|
||||
lda PotMax,x ; Get highest + 1
|
||||
sec ; Subtract lowest
|
||||
sbc PotMin, x
|
||||
bcc +
|
||||
sta PotWidth, x ; Store signal
|
||||
lsr ; width and half signal
|
||||
sta HalfPotWidth, x ; width
|
||||
+ tya ; Restore current value.
|
||||
++ ; Calculate distance
|
||||
tay; Buffer current value.
|
||||
tay ; Buffer current value.
|
||||
sec
|
||||
sbc PotOld,x
|
||||
sbc PotOld, x
|
||||
pha
|
||||
tya
|
||||
sta PotOld,x
|
||||
sta PotOld, x
|
||||
pla
|
||||
beq zero; If not moved, exit.
|
||||
bcc minus; Negative difference
|
||||
beq zero ; If not moved, exit.
|
||||
bcc minus ; Negative difference
|
||||
|
||||
; Positive difference:
|
||||
; Check whether movement caused a value wrap-around.
|
||||
cmp HalfPotWidth,x
|
||||
cmp HalfPotWidth, x
|
||||
bcc Decrease
|
||||
beq Decrease
|
||||
; It did, so calculate "real" distance and jump to exit
|
||||
;sec; C is always set here
|
||||
sbc PotWidth,x; Fix distance
|
||||
;sec ; C is always set here
|
||||
sbc PotWidth, x ; Fix distance
|
||||
|
||||
; We now know that the (fixed) distance is really negative, so we
|
||||
; finally wipe out that annoying bit 0 noise by incrementing the
|
||||
; value.
|
||||
Increase ;clc; C is always clear here
|
||||
Increase ;clc ; C is always clear here
|
||||
adc #$01
|
||||
beq zero; If increasing gives zero, jump to zero handler.
|
||||
ldy #$ff; Set up high byte for negative values.
|
||||
beq zero ; If increasing gives zero, jump to zero handler.
|
||||
ldy #$ff ; Set up high byte for negative values.
|
||||
rts
|
||||
|
||||
; Negative difference:
|
||||
; Check whether movement caused a value wrap-around.
|
||||
minus eor #$ff; Complement
|
||||
minus eor #$ff ; Complement
|
||||
; If we would do a real negation (by adding "1"), then we would need
|
||||
; to branch using BCC *and* BEQ. So the above way might be harder to
|
||||
; understand, but it is both shorter *and* faster - which I like. :)
|
||||
cmp HalfPotWidth,x
|
||||
eor #$ff; Restore value
|
||||
cmp HalfPotWidth, x
|
||||
eor #$ff ; Restore value
|
||||
bcc Increase
|
||||
; Movement caused a value wrap-around, so calculate "real" distance and exit.
|
||||
clc
|
||||
adc PotWidth,x; Fix distance
|
||||
adc PotWidth, x ; Fix distance
|
||||
|
||||
; We now know that the (fixed) distance is really positive, so we
|
||||
; finally wipe out that annoying bit 0 noise by decrementing the value.
|
||||
@ -552,11 +556,11 @@ zero ldy #0
|
||||
|
||||
; If there is no mouse, reset "lowest" ("highest" will have been reset
|
||||
; already) and return zero.
|
||||
ResetMM tay; Set Y to zero.
|
||||
pla; Tidy stack
|
||||
lda #$ff; Reset "lowest"
|
||||
sta PotMin,x
|
||||
tya; Return with A/Y = 0
|
||||
ResetMM tay ; Set Y to zero.
|
||||
pla ; Tidy stack
|
||||
lda #$ff ; Reset "lowest"
|
||||
sta PotMin, x
|
||||
tya ; Return with A/Y = 0
|
||||
rts
|
||||
|
||||
; --- Include sprites
|
||||
@ -571,7 +575,7 @@ ResetMM tay; Set Y to zero.
|
||||
}
|
||||
|
||||
!macro SpriteLine .v {
|
||||
!by .v>>16, (.v>>8)&255, .v&255
|
||||
!by .v >> 16, (.v >> 8) & 255, .v & 255
|
||||
}
|
||||
|
||||
Sprites ; 765432107654321076543210
|
||||
@ -596,7 +600,7 @@ Sprites ; 765432107654321076543210
|
||||
+SpriteLine %........##..............
|
||||
+SpriteLine %........##..............
|
||||
+SpriteLine %........................
|
||||
!byte 0; pad to 64-byte block
|
||||
!byte 0 ; pad to 64-byte block
|
||||
; 765432107654321076543210
|
||||
+SpriteLine %##......................
|
||||
+SpriteLine %###.....................
|
||||
|
@ -1,4 +1,4 @@
|
||||
;ACME 0.94
|
||||
;ACME 0.94.4
|
||||
; ist der komplette Sourcecode von MacEdit
|
||||
; (80-Zeichen-Version)
|
||||
; Version 0.7
|
||||
@ -37,38 +37,40 @@ linebuf
|
||||
|
||||
!eof
|
||||
|
||||
Änderungen von Version 0.6 zu Version 0.7:
|
||||
Änderungen von Version 0.6 zu Version 0.7:
|
||||
Das DCS-Window wurde implementiert, dadurch wurde auch ein Unterschied zwischen "Beenden" und "Basic" eingebaut (Bei ersterem erfolgt die DCS-Abfrage).
|
||||
Die Strings der Windows liegen jetzt nicht mehr als Screencodes vor, sondern als PetSCII-Werte; die Routine ".makewin" konvertiert dies also.
|
||||
Die Bedeutung des Flags "unnamed" wurde invertiert.
|
||||
|
||||
Spätere Änderungen am Source:
|
||||
Spätere Änderungen am Source:
|
||||
|
||||
19. 4.1997: Durch Weiterentwicklung von V0.6 erzeugt (kommentarlos)
|
||||
24. 9.1998: Kommentare von V0.6 wieder hinzugefügt
|
||||
24. 9.1998: Kommentare von V0.6 wieder hinzugefügt
|
||||
25. 9.1998: Umformatierung auf ACME-Syntax
|
||||
10.10.1998: Ersetzen von "{" und "}" in Labels durch "_" und "__"
|
||||
12.10.1998: Unterschiede zu v0.6 dokumentiert.
|
||||
30.10.1998: "+ =" wieder zu "+=" korrigiert.
|
||||
1.11.1998: Alle Labels wieder globalisiert.
|
||||
2.11.1998: Tabulatorlayout wieder korrigiert und "~" durch "___" ersetzt.
|
||||
3.11.1998: Label "notmany!" durch "notmany" ersetzt. Wo kam das bloß her ?
|
||||
4.11.1998: Zwei fehlerhafte Auskommentierungen entsorgt. Die Stellen wurden mit "**mark**" gekennzeichnet. Wo kam das bloß her ? Außerdem wurde "< = >" in einem Textstring wieder zu "<=>" korrigiert. Das ist wohl beim automatischen Layout passiert.
|
||||
4.11.1998: Top-Bit-Set-Zeichen aus Textstrings enfernt und byteweise eingefügt, z.B. auch "Cursor up/down/left/right"-Werte. Außerdem alle Filenamen angepaßt.
|
||||
3.11.1998: Label "notmany!" durch "notmany" ersetzt. Wo kam das bloß her ?
|
||||
4.11.1998: Zwei fehlerhafte Auskommentierungen entsorgt. Die Stellen wurden mit "**mark**" gekennzeichnet. Wo kam das bloß her ? Außerdem wurde "< = >" in einem Textstring wieder zu "<=>" korrigiert. Das ist wohl beim automatischen Layout passiert.
|
||||
4.11.1998: Top-Bit-Set-Zeichen aus Textstrings enfernt und byteweise eingefügt, z.B. auch "Cursor up/down/left/right"-Werte. Außerdem alle Filenamen angepaßt.
|
||||
5.11.1998: Auch die Umlaute nun zu Bytewerten gewandelt.
|
||||
19.11.1998: "!cbm" eingefügt, da geänderte ACME-Funktion "!text".
|
||||
19.11.1998: "!cbm" eingefügt, da geänderte ACME-Funktion "!text".
|
||||
24.11.1998: Filenamen bei "!to" und "!bin" auf UNIX-Stil gebracht.
|
||||
27.11.1998: Aufeinanderfolgende "!tx" und "!by" gemerged, BIT-Trick benutzt, Hexzahlen auf lowercase gebracht, Binärzahlen auf Spezialformat gebracht, Einrückungen dezimiert, Zahlen durch Label ersetzt, "firsttry" in "repeatedtry" umbenannt (war vorher unlogisch).
|
||||
27.11.1998: Aufeinanderfolgende "!tx" und "!by" gemerged, BIT-Trick benutzt, Hexzahlen auf lowercase gebracht, Binärzahlen auf Spezialformat gebracht, Einrückungen dezimiert, Zahlen durch Label ersetzt, "firsttry" in "repeatedtry" umbenannt (war vorher unlogisch).
|
||||
28.11.1998: Auf Benutzung von Modulen und lokalen Labels umgestellt.
|
||||
30.11.1998: Alle "!module" durch "!zone" ersetzt (wegen ACME-Änderung).
|
||||
1.12.1998: Mehrere Labels pro Zeile entzerrt (wegen ACME-Änderung).
|
||||
2.12.1998: Multifile-Version, Änderungstext ans Ende verschoben.
|
||||
30.11.1998: Alle "!module" durch "!zone" ersetzt (wegen ACME-Änderung).
|
||||
1.12.1998: Mehrere Labels pro Zeile entzerrt (wegen ACME-Änderung).
|
||||
2.12.1998: Multifile-Version, Änderungstext ans Ende verschoben.
|
||||
10.12.1998: Makros eingebaut.
|
||||
8. 1.1999: Library benutzt und daher Branch-Makros gelöscht, außerdem BIT-Trick durch Makroaufruf ersetzt.
|
||||
24. 8.1999: An die leicht geänderte Syntax von ACME 007 angepaßt.
|
||||
8. 1.1999: Library benutzt und daher Branch-Makros gelöscht, außerdem BIT-Trick durch Makroaufruf ersetzt.
|
||||
24. 8.1999: An die leicht geänderte Syntax von ACME 007 angepaßt.
|
||||
|
||||
04 Jun 2005:
|
||||
Adjusted to ACME 0.86 syntax (added output file format indicator).
|
||||
26 Mar 2006:
|
||||
Adjusted to ACME 0.91 syntax (anonymous labels)
|
||||
Now throws serious error if the library file could not be loaded.
|
||||
7 Apr 2013:
|
||||
Converted to UTF-8
|
||||
|
@ -1,38 +1,38 @@
|
||||
;ACME 0.91
|
||||
;ACME 0.94.4
|
||||
|
||||
; Konstanten:
|
||||
FALSE = 0 ; Das Programm verläßt sich an etlichen Stellen
|
||||
TRUE = $ff ; darauf, daß genau diese Werte zugewiesen wurden.
|
||||
MODIFIED8 = $ff ; Defaultwerte für
|
||||
FALSE = 0 ; Das Programm verläßt sich an etlichen Stellen
|
||||
TRUE = $ff ; darauf, daß genau diese Werte zugewiesen wurden.
|
||||
MODIFIED8 = $ff ; Defaultwerte für
|
||||
MODIFIED16 = $ffff ; Selbstmodifikationen
|
||||
|
||||
Char_NUL = $00
|
||||
Char_STOP = $03
|
||||
Char_RETURN = $0d
|
||||
Char_CursorDown = $11
|
||||
Char_HOME = $13
|
||||
Char_DEL = $14
|
||||
Char_ESCAPE = $1b
|
||||
Char_CursorRight= $1d
|
||||
Char_At = $40
|
||||
CharOwn_Delete = $74
|
||||
Char_ShiftRETURN= $8d
|
||||
Char_CursorUp = $91 ; Diese Werte waren früher als Strings angegeben.
|
||||
Char_CLEAR = $93
|
||||
Char_INST = $94
|
||||
Char_Grey2 = $98
|
||||
Char_BlueL = $9a
|
||||
Char_Grey3 = $9b
|
||||
Char_CursorLeft = $9d
|
||||
_ = 1 ; Dieser Code steht für das unsichtbare Space in den Windows.
|
||||
Char_NUL = $00
|
||||
Char_STOP = $03
|
||||
Char_RETURN = $0d
|
||||
Char_CursorDown = $11
|
||||
Char_HOME = $13
|
||||
Char_DEL = $14
|
||||
Char_ESCAPE = $1b
|
||||
Char_CursorRight = $1d
|
||||
Char_At = $40
|
||||
CharOwn_Delete = $74
|
||||
Char_ShiftRETURN = $8d
|
||||
Char_CursorUp = $91 ; Diese Werte waren früher als Strings angegeben.
|
||||
Char_CLEAR = $93
|
||||
Char_INST = $94
|
||||
Char_Grey2 = $98
|
||||
Char_BlueL = $9a
|
||||
Char_Grey3 = $9b
|
||||
Char_CursorLeft = $9d
|
||||
_ = 1 ; Dieser Code steht für das unsichtbare Space in den Windows.
|
||||
|
||||
ä = $bb ; Werte um Umlaute verwenden zu können.
|
||||
ö = $bc
|
||||
ü = $bd
|
||||
ß = $be
|
||||
Ä = $db
|
||||
Ö = $dc
|
||||
Ü = $dd
|
||||
ä = $bb ; Werte um Umlaute verwenden zu können.
|
||||
ö = $bc
|
||||
ü = $bd
|
||||
ß = $be
|
||||
Ä = $db
|
||||
Ö = $dc
|
||||
Ü = $dd
|
||||
|
||||
chrol = 104 ; Fensterrahmen
|
||||
chroo = 102
|
||||
@ -58,26 +58,26 @@
|
||||
fnbank = $c7 ; Bank of file name
|
||||
ndx = $d0 ; Tasten- &
|
||||
kyndx = $d1 ; F- Buffer
|
||||
keyidx = $d2 ; F-Zeichenzähler
|
||||
keyidx = $d2 ; F-Zeichenzähler
|
||||
mode = $d7 ; Bit 7 = Cursorscreen (40/80)
|
||||
color = $f1 ; current attribute
|
||||
locks = $f7 ; Verhindert CBM-Shift
|
||||
beep = $f9 ; Tastenklick
|
||||
lftb = $fa ; Maustasten
|
||||
rgtb = $fb
|
||||
line = $fc ; Zähler
|
||||
line = $fc ; Zähler
|
||||
col = $fd
|
||||
zahl = $fe ; fürs Wrap
|
||||
zahl = $fe ; fürs Wrap
|
||||
; System:
|
||||
nmivek = $0318 ; NMI
|
||||
keybuffer= $034a
|
||||
pkydef = $100a ; Strings der F-Tasten
|
||||
texttop = $1210 ; Basic-Ende+1
|
||||
maxmem0 = $1212 ; Ende Bank 0
|
||||
basic = $12fd ; Basic-IRQ
|
||||
kernel_copyfont = $c027 ; Systemroutine, kopiert Font in VDC-RAM
|
||||
kernel_cls = $c142 ; Systemroutine, löscht Screen
|
||||
kernel_switchmode= $cd2e ; Systemroutine, switcht aktiven Monitor
|
||||
nmivek = $0318 ; NMI
|
||||
keybuffer = $034a
|
||||
pkydef = $100a ; Strings der F-Tasten
|
||||
texttop = $1210 ; Basic-Ende+1
|
||||
maxmem0 = $1212 ; Ende Bank 0
|
||||
basic = $12fd ; Basic-IRQ
|
||||
kernel_copyfont = $c027 ; Systemroutine, kopiert Font in VDC-RAM
|
||||
kernel_cls = $c142 ; Systemroutine, löscht Screen
|
||||
kernel_switchmode = $cd2e ; Systemroutine, switcht aktiven Monitor
|
||||
takt = $d030 ; 2 MHz ; register (**mark**)
|
||||
vdc = $d600 ; VDC
|
||||
reg = $d601
|
||||
|
@ -1,4 +1,4 @@
|
||||
;ACME 0.91
|
||||
;ACME 0.94.4
|
||||
|
||||
!zone
|
||||
; Programm:
|
||||
@ -16,18 +16,18 @@ mainloop
|
||||
; hier eigentliche Hauptroutine
|
||||
lda nwfrm ; new frame ?
|
||||
beq +
|
||||
jsr newframe ; yes = >
|
||||
jsr newframe ; yes = >
|
||||
+ lda updatewbi ; update flags?
|
||||
beq +
|
||||
jsr showwbi ; yes = >
|
||||
jsr showwbi ; yes = >
|
||||
+ jsr getchar ; get CHARACTER
|
||||
tax ; & buffer
|
||||
and #%.##..... ; command ?
|
||||
beq + ; yes = >
|
||||
eor #%.##..... ; command ?
|
||||
beq + ; yes = >
|
||||
jsr chrout ; char out
|
||||
jmp mainloop
|
||||
eor #%.##..... ; command ?
|
||||
beq + ; yes = >
|
||||
jsr chrout ; char out
|
||||
jmp mainloop
|
||||
+ jsr execom ; execute command
|
||||
jmp mainloop
|
||||
|
||||
@ -37,8 +37,8 @@ F_esc clc ; 'ESC' on!
|
||||
lda clraktv
|
||||
ldx #hFlag_Escape
|
||||
jsr setflagdata
|
||||
- jsr getkey ; get KEY
|
||||
beq -
|
||||
- jsr getkey ; get KEY
|
||||
beq -
|
||||
sta byte ; & buffer
|
||||
clc ; 'ESC' off!
|
||||
lda clrinak
|
||||
@ -49,17 +49,19 @@ F_esc clc ; 'ESC' on!
|
||||
eor #%.#...... ; a-z ?
|
||||
and #%.##.....
|
||||
bne + ; no = >
|
||||
txa ; get byte
|
||||
and #%...##### ; & short
|
||||
asl ; *2 &
|
||||
tax ; as index
|
||||
lda etab+1,x ; get Hi
|
||||
beq .no ; 0 = >
|
||||
sta .m+1 ; set
|
||||
lda etab,x ; get Lo
|
||||
sta .m ; set
|
||||
.m=*+1: jmp MODIFIED16 ; execute sequence
|
||||
txa ; get byte
|
||||
and #%...##### ; & short
|
||||
asl ; *2 &
|
||||
tax ; as index
|
||||
lda etab + 1, x ; get Hi
|
||||
beq .no ; 0 = >
|
||||
sta .m + 1 ; set
|
||||
lda etab, x ; get Lo
|
||||
sta .m ; set
|
||||
.m = * + 1: jmp MODIFIED16 ; execute sequence
|
||||
|
||||
.no rts ; nothing...
|
||||
|
||||
+ txa ; get byte ( = FKey?)
|
||||
bpl .no ; out = >
|
||||
eor #%..#..... ; convert
|
||||
@ -85,15 +87,15 @@ nmirtn lda #0 ; clear keybuffers
|
||||
; Subs:
|
||||
execom txa ; get & convert Byte
|
||||
bpl + ; (therefore strange
|
||||
eor #%#.#..... ; vectorlist)
|
||||
eor #%#.#..... ; vectorlist)
|
||||
+ asl
|
||||
tax
|
||||
lda ctab+1,x ; get Hi
|
||||
lda ctab + 1, x ; get Hi
|
||||
beq noroutine ; 0 = >
|
||||
sta .m+1 ; and set
|
||||
lda ctab,x ; get Lo
|
||||
sta .m + 1 ; and set
|
||||
lda ctab, x ; get Lo
|
||||
sta .m ; and set
|
||||
.m=*+1: jmp MODIFIED16 ; use command
|
||||
.m = * + 1: jmp MODIFIED16 ; use command
|
||||
|
||||
noroutine rts ; not defined (fixme - could save a byte here)
|
||||
|
||||
@ -106,10 +108,10 @@ F_new jsr willblost
|
||||
stx nwfrm
|
||||
stx updatewbi
|
||||
stx unnamed
|
||||
- lda newname,x
|
||||
sta txtname,x
|
||||
dex
|
||||
bpl -
|
||||
- lda newname, x
|
||||
sta txtname, x
|
||||
dex
|
||||
bpl -
|
||||
inx
|
||||
stx changes
|
||||
rts
|
||||
@ -125,12 +127,12 @@ newtext ldx #1 ; '1'
|
||||
stx endy
|
||||
stx posy
|
||||
dex ; '0'
|
||||
stx scry+1 ; ...as Y-Hi
|
||||
stx anfy+1
|
||||
stx endy+1
|
||||
stx posy+1
|
||||
stx scry + 1 ; ...as Y-Hi
|
||||
stx anfy + 1
|
||||
stx endy + 1
|
||||
stx posy + 1
|
||||
stx zzbe ; no lines
|
||||
stx zzbe+1 ; used
|
||||
stx zzbe + 1 ; used
|
||||
rts
|
||||
|
||||
!zone
|
||||
@ -156,29 +158,29 @@ getkey ;{check mousejob}
|
||||
sei ; else
|
||||
ldy keybuffer ; get first byte
|
||||
ldx #255 - 8 ; loop to shift other 9 chars down
|
||||
- lda keybuffer - 255 + 9,x
|
||||
sta keybuffer - 255 + 8,x
|
||||
inx ; (f7 to ff)
|
||||
bne -
|
||||
- lda keybuffer - 255 + 9, x
|
||||
sta keybuffer - 255 + 8, x
|
||||
inx ; (f7 to ff)
|
||||
bne -
|
||||
dec ndx ; dec number
|
||||
tya ; byte = >A
|
||||
stx keybuffer+9 ; clear lastbyte
|
||||
stx keybuffer + 9 ; clear lastbyte
|
||||
cli
|
||||
rts
|
||||
|
||||
!zone
|
||||
getvvek lda scry,x ; get y-Lo
|
||||
getvvek lda scry, x ; get y-Lo
|
||||
asl ; *2
|
||||
tay ; buffer
|
||||
lda scry+1,x ; get y-Hi
|
||||
lda scry + 1, x ; get y-Hi
|
||||
rol ; *2 ( = clc)
|
||||
sta vvek+1 ; in Hi
|
||||
sta vvek + 1 ; in Hi
|
||||
tya ; get Lo
|
||||
adc memin ; + BaseLo
|
||||
sta vvek ; = VectorLo
|
||||
lda vvek+1 ; get Hi
|
||||
adc memin+1 ; + BaseHi
|
||||
sta vvek+1 ; = VectorHi
|
||||
lda vvek + 1 ; get Hi
|
||||
adc memin + 1 ; + BaseHi
|
||||
sta vvek + 1 ; = VectorHi
|
||||
rts ; (VekVek)
|
||||
|
||||
; stellt Vektor auf Cursor-Y
|
||||
@ -188,38 +190,38 @@ poslvek ldx #POS
|
||||
!zone
|
||||
getlvek jsr getvvek ; get VekVek
|
||||
ldy #0 ; Y-Init
|
||||
lda (vvek),y ; get Lo-Byte
|
||||
lda (vvek), y ; get Lo-Byte
|
||||
sta lvek ; store
|
||||
iny ; inc vector
|
||||
lda (vvek),y ; get Hi-Byte
|
||||
sta lvek+1 ; store
|
||||
lda (vvek), y ; get Hi-Byte
|
||||
sta lvek + 1 ; store
|
||||
rts
|
||||
|
||||
!zone
|
||||
windowproof lda posx ;crsr-X
|
||||
cmp scrx ; screen(home)-X
|
||||
bcs + ; bigger = >
|
||||
sta scrx ; else set screen-X
|
||||
sta nwfrm ; and NewFrame
|
||||
bcc .UpDown
|
||||
sta scrx ; else set screen-X
|
||||
sta nwfrm ; and NewFrame
|
||||
bcc .UpDown
|
||||
+ sbc scrx ; difference
|
||||
cmp #scrcols ; cmp screenwidth
|
||||
bcc .UpDown ; ok = >
|
||||
lda posx ; else NewFrame,
|
||||
sta nwfrm
|
||||
sbc #scrcols-1 ; set screen-X
|
||||
sbc #scrcols - 1 ; set screen-X
|
||||
sta scrx ; & store
|
||||
.UpDown lda scry+1 ; HiByte screen-
|
||||
cmp posy+1 ; Y and crsr-Y
|
||||
.UpDown lda scry + 1 ; HiByte screen-
|
||||
cmp posy + 1 ; Y and crsr-Y
|
||||
bcc crsrweiter ; shorter = >
|
||||
bne .set ; equal = >
|
||||
lda posy ; else cmp Lo-bytes
|
||||
cmp scry
|
||||
bcs crsrweiter ; shorter = >
|
||||
.set ldx posy ; get crsrpos as
|
||||
lda posy+1 ; new screenstart
|
||||
lda posy + 1 ; new screenstart
|
||||
stx scry
|
||||
sta scry+1
|
||||
sta scry + 1
|
||||
lda #TRUE ; NewFrame
|
||||
sta nwfrm
|
||||
rts
|
||||
@ -229,19 +231,19 @@ crsrweiter sec ; for sbc
|
||||
lda posy ; calculate
|
||||
sbc scry ; Lo-difference
|
||||
tax ; in X
|
||||
lda posy+1 ; calculate
|
||||
sbc scry+1 ; Hi-difference
|
||||
lda posy + 1 ; calculate
|
||||
sbc scry + 1 ; Hi-difference
|
||||
bne + ; if Hi = 0
|
||||
cpx #scrlins ; & Lo ok,
|
||||
bcc ++ ; ready = >
|
||||
+ lda posy+1 ; else: copy Hibyte
|
||||
sta scry+1
|
||||
cpx #scrlins ; & Lo ok,
|
||||
bcc ++ ; ready = >
|
||||
+ lda posy + 1 ; else: copy Hibyte
|
||||
sta scry + 1
|
||||
sec ; for sbc
|
||||
lda posy ; calculate & save
|
||||
sbc #scrlins-1 ; new Hibyte
|
||||
sbc #scrlins - 1 ; new Hibyte
|
||||
sta scry
|
||||
bcs + ; ggfs. = >
|
||||
dec scry+1 ; correct Hibyte
|
||||
dec scry + 1 ; correct Hibyte
|
||||
+ lda #TRUE ; NewFrame
|
||||
sta nwfrm
|
||||
++ rts
|
||||
@ -251,40 +253,40 @@ crsrweiter sec ; for sbc
|
||||
; fuellt Speicher mit Zeilen
|
||||
fillmem lda #0 ; Keine Zeilen da
|
||||
sta zzan
|
||||
sta zzan+1
|
||||
sta zzan + 1
|
||||
ldx llen ; Zeilenlaenge
|
||||
inx ; + Info-Byte
|
||||
stx .m1 ; in SBC #$dummy
|
||||
lda maxmem0 ; holt MAX-MEM-0
|
||||
sta txts ; und nimmt es als
|
||||
lda maxmem0+1 ; Obergrenze !
|
||||
sta txts+1
|
||||
lda maxmem0 + 1 ; Obergrenze !
|
||||
sta txts + 1
|
||||
lda mod_id ; Holt ID-Adresse (Lo)
|
||||
tax ; sichern
|
||||
lsr ; Bit 0 ins Carry
|
||||
txa ; zurueck
|
||||
adc #6 ; +ID-2+C
|
||||
sta memin ; wird Vektorstart (Lo)
|
||||
lda mod_id+1 ; Hi-Byte
|
||||
lda mod_id + 1 ; Hi-Byte
|
||||
adc #0 ; entsprechend
|
||||
sta memin+1 ; anpassen (Auto-CLC)
|
||||
sta memin + 1 ; anpassen (Auto-CLC)
|
||||
; Carry wird addiert, damit Vektoren bei
|
||||
; einer GERADEN Adresse starten!
|
||||
lda memin ; Die VekVeks
|
||||
adc #2 ; werden ab dem
|
||||
sta vvek ; Vektorstart+2
|
||||
lda memin+1 ; abgelegt, da es
|
||||
lda memin + 1 ; abgelegt, da es
|
||||
adc #0 ; keine nullte Zeile
|
||||
sta vvek+1 ; gibt
|
||||
sta vvek + 1 ; gibt
|
||||
.Check lda txts ; TextstartLo
|
||||
sec
|
||||
.m1=*+1: sbc #MODIFIED8 ; -Zeilenlänge
|
||||
.m1 = * + 1: sbc #MODIFIED8 ; -Zeilenlänge
|
||||
sta tmp1 ; wird gepuffert
|
||||
ldx txts+1
|
||||
ldx txts + 1
|
||||
bcs +
|
||||
dex
|
||||
+ stx tmp1+1
|
||||
cpx vvek+1 ; Vektorkollision ?
|
||||
dex
|
||||
+ stx tmp1 + 1
|
||||
cpx vvek + 1 ; Vektorkollision ?
|
||||
bcc .NoLine ; Ja = > keine Zeile !
|
||||
bne .MakeLn ; Nein = > neue Zeile !
|
||||
ldx vvek ; Gleich: Lo-Bytes
|
||||
@ -294,27 +296,27 @@ fillmem lda #0 ; Keine Zeilen da
|
||||
.MakeLn lda tmp1 ; Nein: dann temp als
|
||||
sta txts ; Textstart und in den
|
||||
ldy #0 ; Linevektor
|
||||
sta (vvek),y
|
||||
lda tmp1+1 ; dito, Highbyte
|
||||
sta txts+1
|
||||
sta (vvek), y
|
||||
lda tmp1 + 1 ; dito, Highbyte
|
||||
sta txts + 1
|
||||
iny
|
||||
sta (vvek),y
|
||||
sta (vvek), y
|
||||
inc vvek ; VekVek 2 Byte weiter
|
||||
+inc16 vvek
|
||||
inc zzan ; angelegte Zeilen
|
||||
bne .Check ; eins hoeher
|
||||
inc zzan+1
|
||||
inc zzan + 1
|
||||
jmp .Check
|
||||
.NoLine rts
|
||||
|
||||
!zone
|
||||
clearline lda #" " ; Space
|
||||
ldy llen ; Y auf Zeilenende
|
||||
- sta (lvek),y ; Space setzen
|
||||
dey ; zurueck
|
||||
bne - ; Infobyte ?
|
||||
- sta (lvek), y ; Space setzen
|
||||
dey ; zurueck
|
||||
bne - ; Infobyte ?
|
||||
tya ; Dann auf
|
||||
sta (lvek),y ; Null setzen
|
||||
sta (lvek), y ; Null setzen
|
||||
dey ; Y auf $ff fuer
|
||||
sty nwfrm ; NewFrame
|
||||
sty changes ; Veraendert !
|
||||
@ -325,21 +327,21 @@ clearline lda #" " ; Space
|
||||
; stellt Zeilen zur Verfuegung oder gibt Fehlermeldung
|
||||
needline +cmp16bit ZZA, ZZB ; vergleichen
|
||||
beq + ; Wenn gleich, wirds gesetzte Carry 'failure'
|
||||
+inc16 zzbe ; sonst: Zahl der genutzten Zeilen hoeher
|
||||
ldx #ZZB
|
||||
stx changes ; Veraendert !
|
||||
jsr getlvek ; Holt Vektor
|
||||
jsr clearline ; und leert Zeile
|
||||
clc ; 'success'
|
||||
+inc16 zzbe ; sonst: Zahl der genutzten Zeilen hoeher
|
||||
ldx #ZZB
|
||||
stx changes ; Veraendert !
|
||||
jsr getlvek ; Holt Vektor
|
||||
jsr clearline ; und leert Zeile
|
||||
clc ; 'success'
|
||||
; EIGENTLICH ist das Carrybit hier schon
|
||||
; durch die beiden Subs gelöscht...
|
||||
; durch die beiden Subs gelöscht...
|
||||
+ rts
|
||||
|
||||
cmp16bit lda scry+1,x ; Hi-Bytes vergleichen
|
||||
cmp scry+1,y
|
||||
cmp16bit lda scry + 1, x ; Hi-Bytes vergleichen
|
||||
cmp scry + 1, y
|
||||
bne + ; wenn gleich,
|
||||
lda scry,x ; Lo-Bytes vergleichen
|
||||
cmp scry,y
|
||||
lda scry, x ; Lo-Bytes vergleichen
|
||||
cmp scry, y
|
||||
+ rts
|
||||
|
||||
F_gcr inc posx
|
||||
@ -350,7 +352,7 @@ F_gcl dec posx
|
||||
|
||||
F_gcu ldx posy
|
||||
bne +
|
||||
dec posy+1
|
||||
dec posy + 1
|
||||
+ dec posy
|
||||
jmp proofpos
|
||||
|
||||
@ -362,7 +364,7 @@ proofpos ldx posx ; CRSR-X
|
||||
dex ; verringern und mit
|
||||
cpx llen ; Laenge vergl.
|
||||
bcs jump ; zu weit rechts = >
|
||||
lda posy+1 ; CRSR-Y (Hi)
|
||||
lda posy + 1 ; CRSR-Y (Hi)
|
||||
bmi firstline ; >32K = > 1. Zeile = >
|
||||
ora posy ; ODERt Low-Byte
|
||||
beq firstline ; = 0 = > 1. Zeile = >
|
||||
@ -381,16 +383,16 @@ proofpos ldx posx ; CRSR-X
|
||||
|
||||
jump jsr newline ; naechste Zeile
|
||||
bcs + ; CRSR zu weit,
|
||||
jsr needline ; Zeile anfordern
|
||||
bcc + ; Bei Fehlschlag
|
||||
jsr memfull ; Warnung zeigen
|
||||
jsr needline ; Zeile anfordern
|
||||
bcc + ; Bei Fehlschlag
|
||||
jsr memfull ; Warnung zeigen
|
||||
+ jmp proofpos
|
||||
|
||||
!zone
|
||||
firstline ldx #1 ; CRSR in erste Zeile
|
||||
stx posy
|
||||
dex
|
||||
stx posy+1
|
||||
stx posy + 1
|
||||
jmp windowproof
|
||||
|
||||
F_geot +cp16 zzbe, posy; CRSR in letzte Zeile
|
||||
@ -414,10 +416,10 @@ chrout stx byte ; sichert Zeichen
|
||||
jsr poslvek ; LineVek
|
||||
ldy esca ; Autoinsert ?
|
||||
beq + ; ggfs. kein
|
||||
jsr insert1 ; insert
|
||||
jsr insert1 ; insert
|
||||
+ ldy posx ; Versatz
|
||||
lda byte ; Akku holen
|
||||
sta (lvek),y ; und setzen
|
||||
sta (lvek), y ; und setzen
|
||||
jsr poswrap ; Wrap ?
|
||||
lda #TRUE ; NewFrame fordern
|
||||
sta nwfrm
|
||||
@ -431,25 +433,25 @@ F_insert jsr poslvek ; LineVek
|
||||
rts ; fixme - could save a byte here
|
||||
|
||||
!zone
|
||||
insert1 ldy scrx,x ; X-Wert holen & in
|
||||
insert1 ldy scrx, x ; X-Wert holen & in
|
||||
sty .mod ; Immediate
|
||||
ldy lvek+1 ; Quell-Vektor =
|
||||
ldy lvek + 1 ; Quell-Vektor =
|
||||
ldx lvek ; aktueller Vektor-1
|
||||
bne +
|
||||
dey
|
||||
dey
|
||||
+ dex
|
||||
stx tmp1
|
||||
sty tmp1+1
|
||||
sty tmp1 + 1
|
||||
ldy llen ; Shiftstart LineEnd
|
||||
-
|
||||
.mod=*+1: cpy #MODIFIED8 ; X
|
||||
beq + ; Ende = >
|
||||
lda (tmp1),y ; Zeichen holen
|
||||
sta (lvek),y ; und shiften
|
||||
dey ; neue Pos
|
||||
jmp -
|
||||
.mod = * + 1: cpy #MODIFIED8 ; X
|
||||
beq + ; Ende = >
|
||||
lda (tmp1), y ; Zeichen holen
|
||||
sta (lvek), y ; und shiften
|
||||
dey ; neue Pos
|
||||
jmp -
|
||||
+ lda #" " ; 'Space' an
|
||||
sta (lvek),y ; Pos setzen
|
||||
sta (lvek), y ; Pos setzen
|
||||
sta nwfrm ; NewFrame fordern
|
||||
sta changes ; Veraendert !
|
||||
rts
|
||||
@ -462,24 +464,24 @@ F_dcr jsr poslvek ; LineVek
|
||||
jmp proofpos
|
||||
|
||||
!zone
|
||||
delchr1 ldy scrx,x ; X-Wert in Immediate
|
||||
delchr1 ldy scrx, x ; X-Wert in Immediate
|
||||
sty .m
|
||||
ldx lvek ; Zielvektor = aktueller
|
||||
ldy lvek+1 ; Vektor+1
|
||||
ldy lvek + 1 ; Vektor+1
|
||||
inx
|
||||
bne +
|
||||
iny
|
||||
iny
|
||||
+ stx tmp1
|
||||
sty tmp1+1
|
||||
.m=*+1: ldy #MODIFIED8 ; X
|
||||
- cpy llen ; Zeilenende ?
|
||||
beq + ; Dann = >
|
||||
lda (tmp1),y ; Zeichen holen
|
||||
sta (lvek),y ; und shiften
|
||||
iny ; neue Pos
|
||||
jmp -
|
||||
sty tmp1 + 1
|
||||
.m = * + 1: ldy #MODIFIED8 ; X
|
||||
- cpy llen ; Zeilenende ?
|
||||
beq + ; Dann = >
|
||||
lda (tmp1), y ; Zeichen holen
|
||||
sta (lvek), y ; und shiften
|
||||
iny ; neue Pos
|
||||
jmp -
|
||||
+ lda #" " ; Space an letzte
|
||||
sta (lvek),y ; Pos setzen
|
||||
sta (lvek), y ; Pos setzen
|
||||
lda #TRUE ; NewFrame fordern
|
||||
sta nwfrm
|
||||
sta changes ; Veraendert !
|
||||
@ -491,36 +493,36 @@ delchr1 ldy scrx,x ; X-Wert in Immediate
|
||||
; liegt die Endzeile in der Startzeile
|
||||
rollfwd jsr howmany ; Zeilenanzahl ?
|
||||
beq ++ ; ggfs Abbruch !
|
||||
tya ; Y in X
|
||||
tax
|
||||
jsr getlvek ; lvek in lvek puffern
|
||||
sec ; Quellvektor = Vektor-2
|
||||
lda vvek
|
||||
sbc #2
|
||||
sta tmp1
|
||||
lda vvek+1
|
||||
sbc #0
|
||||
sta tmp1+1
|
||||
ldy #2 ; Versatz 2
|
||||
- tya ; Y pruefen
|
||||
bne + ; ggfs
|
||||
dec tmp1+1 ; Page sichern
|
||||
dec vvek+1
|
||||
+ dey ; Versatz runter
|
||||
lda (tmp1),y ; High-Byte oben setzen
|
||||
sta (vvek),y
|
||||
dey ; Versatz runter
|
||||
lda (tmp1),y ; Low-Byte oben setzen
|
||||
sta (vvek),y
|
||||
inc tmpy ; Anzahl der Shifts
|
||||
bne - ; pruefen, ggfs loop
|
||||
inc tmpy+1
|
||||
bne -
|
||||
lda lvek ; alten Vektor holen
|
||||
sta (tmp1),y ; und in letzte
|
||||
iny ; Position setzen
|
||||
lda lvek+1
|
||||
sta (tmp1),y
|
||||
tya ; Y in X
|
||||
tax
|
||||
jsr getlvek ; lvek in lvek puffern
|
||||
sec ; Quellvektor = Vektor-2
|
||||
lda vvek
|
||||
sbc #2
|
||||
sta tmp1
|
||||
lda vvek + 1
|
||||
sbc #0
|
||||
sta tmp1 + 1
|
||||
ldy #2 ; Versatz 2
|
||||
- tya ; Y pruefen
|
||||
bne + ; ggfs
|
||||
dec tmp1 + 1 ; Page sichern
|
||||
dec vvek + 1
|
||||
+ dey ; Versatz runter
|
||||
lda (tmp1), y ; High-Byte oben setzen
|
||||
sta (vvek), y
|
||||
dey ; Versatz runter
|
||||
lda (tmp1), y ; Low-Byte oben setzen
|
||||
sta (vvek), y
|
||||
inc tmpy ; Anzahl der Shifts
|
||||
bne - ; pruefen, ggfs loop
|
||||
inc tmpy + 1
|
||||
bne -
|
||||
lda lvek ; alten Vektor holen
|
||||
sta (tmp1), y ; und in letzte
|
||||
iny ; Position setzen
|
||||
lda lvek + 1
|
||||
sta (tmp1), y
|
||||
++ lda #TRUE ; NewFrame fordern
|
||||
sta nwfrm
|
||||
sta changes ; Veraendert !
|
||||
@ -532,33 +534,33 @@ rollfwd jsr howmany ; Zeilenanzahl ?
|
||||
; liegt die Startzeile in der Endzeile !
|
||||
rollrwd jsr howmany ; Zeilenanzahl ?
|
||||
beq ++ ; ggfs Abbruch !
|
||||
jsr getlvek ; lvek in lvek puffern
|
||||
clc ; Quellvektor = Vektor+2
|
||||
lda vvek
|
||||
adc #2
|
||||
sta tmp1
|
||||
lda vvek+1
|
||||
adc #0
|
||||
sta tmp1+1
|
||||
ldy #0 ; Versatz 0
|
||||
- lda (tmp1),y ; Hi-Byte unten setzen
|
||||
sta (vvek),y
|
||||
iny ; weiter
|
||||
lda (tmp1),y ; Lo-Byte unten setzen
|
||||
sta (vvek),y
|
||||
iny ; weiter
|
||||
bne + ; Page sichern
|
||||
inc tmp1+1
|
||||
inc vvek+1
|
||||
+ inc tmpy ; Anzahl Shifts
|
||||
bne - ; pruefen, ggfs loop
|
||||
inc tmpy+1
|
||||
bne -
|
||||
lda lvek ; alten Vektor an die
|
||||
sta (vvek),y ; letzte Pos setzen
|
||||
iny
|
||||
lda lvek+1
|
||||
sta (vvek),y
|
||||
jsr getlvek ; lvek in lvek puffern
|
||||
clc ; Quellvektor = Vektor+2
|
||||
lda vvek
|
||||
adc #2
|
||||
sta tmp1
|
||||
lda vvek + 1
|
||||
adc #0
|
||||
sta tmp1 + 1
|
||||
ldy #0 ; Versatz 0
|
||||
- lda (tmp1), y ; Hi-Byte unten setzen
|
||||
sta (vvek), y
|
||||
iny ; weiter
|
||||
lda (tmp1), y ; Lo-Byte unten setzen
|
||||
sta (vvek), y
|
||||
iny ; weiter
|
||||
bne + ; Page sichern
|
||||
inc tmp1 + 1
|
||||
inc vvek + 1
|
||||
+ inc tmpy ; Anzahl Shifts
|
||||
bne - ; pruefen, ggfs loop
|
||||
inc tmpy + 1
|
||||
bne -
|
||||
lda lvek ; alten Vektor an die
|
||||
sta (vvek), y ; letzte Pos setzen
|
||||
iny
|
||||
lda lvek + 1
|
||||
sta (vvek), y
|
||||
++ lda #TRUE ; NewFrame fordern
|
||||
sta nwfrm
|
||||
sta changes ; Veraendert !
|
||||
@ -567,24 +569,24 @@ rollrwd jsr howmany ; Zeilenanzahl ?
|
||||
!zone
|
||||
howmany jsr cmp16bit ; Sicherheit
|
||||
bcs + ; ggfs Abbruch = >
|
||||
sec ; Negativ, um INC statt DEC nutzen zu können
|
||||
lda scry,x
|
||||
sbc scry,y
|
||||
sta tmpy
|
||||
lda scry+1,x
|
||||
sbc scry+1,y
|
||||
sta tmpy+1
|
||||
rts
|
||||
sec ; Negativ, um INC statt DEC nutzen zu können
|
||||
lda scry, x
|
||||
sbc scry, y
|
||||
sta tmpy
|
||||
lda scry + 1, x
|
||||
sbc scry + 1, y
|
||||
sta tmpy + 1
|
||||
rts
|
||||
+ lda #0 ; Zeilen
|
||||
rts
|
||||
|
||||
!zone
|
||||
movx2y lda scrx,x ; Copy X-indexed Werte in Y-indexed Variablen
|
||||
sta scrx,y
|
||||
lda scry,x
|
||||
sta scry,y
|
||||
lda scry+1,x
|
||||
sta scry+1,y
|
||||
movx2y lda scrx, x ; Copy X-indexed Werte in Y-indexed Variablen
|
||||
sta scrx, y
|
||||
lda scry, x
|
||||
sta scry, y
|
||||
lda scry + 1, x
|
||||
sta scry + 1, y
|
||||
rts
|
||||
|
||||
ESC_at rts ; fixme - could save one byte here
|
||||
@ -602,18 +604,18 @@ ESC_b ldx #POS ; BlockEnd: = Cursorposition
|
||||
; Block legal ? Vertauscht ggfs Zeiger
|
||||
nblck +cmp16bit ANF, END ; Blockstart und -Ende vergleichen
|
||||
bcc ++ ; anf<end: ok
|
||||
bne + ; anf>end: not ok
|
||||
lda scrx,y ; Bei Gleichheit noch
|
||||
cmp scrx,x ; X pruefen
|
||||
bcs ++ ; end> = anf: ok
|
||||
+ ldy #TMP ; (Anf) in Temp
|
||||
jsr movx2y
|
||||
ldx #END ; Ende in Anf
|
||||
ldy #ANF
|
||||
jsr movx2y
|
||||
ldx #TMP ; Temp in Ende
|
||||
ldy #END
|
||||
jsr movx2y
|
||||
bne + ; anf>end: not ok
|
||||
lda scrx, y ; Bei Gleichheit noch
|
||||
cmp scrx, x ; X pruefen
|
||||
bcs ++ ; end> = anf: ok
|
||||
+ ldy #TMP ; (Anf) in Temp
|
||||
jsr movx2y
|
||||
ldx #END ; Ende in Anf
|
||||
ldy #ANF
|
||||
jsr movx2y
|
||||
ldx #TMP ; Temp in Ende
|
||||
ldy #END
|
||||
jsr movx2y
|
||||
++ lda #TRUE ; NewFrame fordern
|
||||
sta nwfrm ; (Blockanzeige)
|
||||
sta blockflag ; Block ein
|
||||
@ -635,12 +637,12 @@ delline ldy #ZZB ; Ende: LastLine
|
||||
jsr rollrwd ; runterrollen
|
||||
lda zzbe ; Anzahl der benutzten Zeilen runter
|
||||
bne +
|
||||
dec zzbe+1
|
||||
dec zzbe + 1
|
||||
+ dec zzbe
|
||||
bne + ; Low = 0 ?
|
||||
lda zzbe+1 ; Dann High pruefen und ggfs Zeile fordern
|
||||
bne +
|
||||
jsr needline
|
||||
lda zzbe + 1 ; Dann High pruefen und ggfs Zeile fordern
|
||||
bne +
|
||||
jsr needline
|
||||
+ jmp proofpos
|
||||
|
||||
!zone
|
||||
@ -691,12 +693,12 @@ ESC_t ldx #POS ; Blockstart = Cursorposition
|
||||
|
||||
F_home ldx scrx ; Normal HOME only,
|
||||
ldy scry ; if CRSR not there
|
||||
lda scry+1
|
||||
lda scry + 1
|
||||
cpx posx ; Otherwise ScreenUp
|
||||
bne scrnhome
|
||||
cpy posy
|
||||
bne scrnhome
|
||||
cmp posy+1
|
||||
cmp posy + 1
|
||||
bne scrnhome
|
||||
|
||||
!zone
|
||||
@ -705,7 +707,7 @@ F_scrnu lda posy ; Displaystart =
|
||||
sbc #scrlins ; - Zeilenzahl
|
||||
sta posy
|
||||
bcs +
|
||||
dec posy+1
|
||||
dec posy + 1
|
||||
+ lda #TRUE ; NewFrame fordern
|
||||
sta nwfrm
|
||||
jmp proofpos
|
||||
@ -713,14 +715,14 @@ F_scrnu lda posy ; Displaystart =
|
||||
!zone
|
||||
scrnhome stx posx ; Cursor: = Display
|
||||
sty posy
|
||||
sta posy+1
|
||||
sta posy + 1
|
||||
jmp proofpos
|
||||
|
||||
F_ahome clc ; errechnet Werte
|
||||
lda scry ; fuer antih1
|
||||
adc #scrlins-1 ; in A, X, Y
|
||||
adc #scrlins - 1 ; in A, X, Y
|
||||
tax
|
||||
lda scry+1
|
||||
lda scry + 1
|
||||
adc #0
|
||||
tay
|
||||
lda scrx ; CRSR dort ?
|
||||
@ -728,7 +730,7 @@ F_ahome clc ; errechnet Werte
|
||||
bne antih1
|
||||
cpx posy ; Nein = > dorthin
|
||||
bne antih1
|
||||
cpy posy+1 ; Ja = > ScreenDown !
|
||||
cpy posy + 1 ; Ja = > ScreenDown !
|
||||
bne antih1
|
||||
|
||||
!zone
|
||||
@ -737,7 +739,7 @@ F_scrnd lda posy ; One screen down
|
||||
adc #scrlins
|
||||
sta posy
|
||||
bcc +
|
||||
inc posy+1
|
||||
inc posy + 1
|
||||
+ lda #TRUE ; NewFrame fordern
|
||||
sta nwfrm
|
||||
jmp proofpos
|
||||
@ -745,7 +747,7 @@ F_scrnd lda posy ; One screen down
|
||||
!zone
|
||||
antih1 sta posx ; Cursor: = DisplayEnd
|
||||
stx posy
|
||||
sty posy+1
|
||||
sty posy + 1
|
||||
jmp proofpos
|
||||
|
||||
F_gsot ldx #1 ; X = Y = 1
|
||||
@ -753,31 +755,31 @@ F_gsot ldx #1 ; X = Y = 1
|
||||
stx posy
|
||||
stx nwfrm ; NewFrame fordern
|
||||
dex ; Y-Hi: = 0
|
||||
stx posy+1
|
||||
stx posy + 1
|
||||
jmp proofpos
|
||||
|
||||
!zone
|
||||
handleid ldx #7 ; 8 Byte Kennung
|
||||
-
|
||||
mod_id=*+1: lda MODIFIED16,x; Schleife, um evtl. vorhandenen Text zu
|
||||
cmp idtext,x
|
||||
bne makeid ; erkennen & zu reaktivieren
|
||||
dex
|
||||
bpl -
|
||||
mod_id = * + 1: lda MODIFIED16, x; Schleife, um evtl. vorhandenen Text zu
|
||||
cmp idtext, x
|
||||
bne makeid ; erkennen & zu reaktivieren
|
||||
dex
|
||||
bpl -
|
||||
clc ; 'OldText'
|
||||
rts
|
||||
|
||||
makeid lda texttop ; Neue ID wird ans Basic-Ende gesetzt
|
||||
sta mod_id
|
||||
sta .m1
|
||||
lda texttop+1
|
||||
sta mod_id+1
|
||||
sta .m1+1
|
||||
lda texttop + 1
|
||||
sta mod_id + 1
|
||||
sta .m1 + 1
|
||||
ldx #7
|
||||
- lda idtext,x
|
||||
.m1=*+1: sta MODIFIED16,x
|
||||
dex
|
||||
bpl -
|
||||
- lda idtext, x
|
||||
.m1 = * + 1: sta MODIFIED16, x
|
||||
dex
|
||||
bpl -
|
||||
sec ; 'NewText'
|
||||
rts
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
;ACME 0.91
|
||||
;ACME 0.94.4
|
||||
|
||||
; ab hier liegt die Cursorsteuerung
|
||||
; A = screenx, Y = screeny
|
||||
@ -10,50 +10,48 @@ crsrset sta .m ; buffer x
|
||||
sty .n ; buffer y
|
||||
jsr crsroff
|
||||
lda #0 ; clear Hi
|
||||
sta vtemp+1
|
||||
.n=*+1: lda #MODIFIED8 ; y
|
||||
sta vtemp + 1
|
||||
.n = * + 1: lda #MODIFIED8 ; y
|
||||
asl ; *2
|
||||
asl ; *4
|
||||
rol vtemp+1
|
||||
rol vtemp + 1
|
||||
asl ; *8
|
||||
rol vtemp+1
|
||||
rol vtemp + 1
|
||||
asl ; *16
|
||||
rol vtemp+1
|
||||
rol vtemp + 1
|
||||
sta vtemp ; stash Lo
|
||||
ldy vtemp+1 ; copy Hi
|
||||
sty vtemp+2
|
||||
ldy vtemp + 1 ; copy Hi
|
||||
sty vtemp + 2
|
||||
asl ; *32
|
||||
rol vtemp+2
|
||||
rol vtemp + 2
|
||||
asl ; *64
|
||||
rol vtemp+2
|
||||
rol vtemp + 2
|
||||
adc vtemp ; + 16er-Lo
|
||||
sta vtemp ; 80er-Lo in vtemp
|
||||
bcc + ; page
|
||||
inc vtemp+1
|
||||
clc
|
||||
inc vtemp + 1
|
||||
clc
|
||||
+
|
||||
.m=*+1: adc #MODIFIED8 ; x
|
||||
.m = * + 1: adc #MODIFIED8 ; x
|
||||
sta vtemp ; store Lo
|
||||
lda vtemp+1 ; get 16er-Hi
|
||||
adc vtemp+2 ; add 64er-Hi
|
||||
lda vtemp + 1 ; get 16er-Hi
|
||||
adc vtemp + 2 ; add 64er-Hi
|
||||
adc #attrhi ; add base
|
||||
sta vtemp+1 ; store Hi
|
||||
sta vtemp + 1 ; store Hi
|
||||
|
||||
!zone
|
||||
crsron lda conreg ; buffert CR
|
||||
sta .m
|
||||
+bank15
|
||||
jsr vpntcrsr ; set address
|
||||
- bit vdc ; get ready
|
||||
bpl -
|
||||
+wait_for_vdc
|
||||
lda reg ; get attribute
|
||||
sta tcolor ; buffer it
|
||||
jsr vpntcrsr ; set address
|
||||
lda clrcrsr ; get crsr
|
||||
- bit vdc ; get ready
|
||||
bpl -
|
||||
+wait_for_vdc
|
||||
sta reg ; set crsr
|
||||
.m=*+1: lda #MODIFIED8 ; bank
|
||||
.m = * + 1: lda #MODIFIED8 ; bank
|
||||
sta conreg ; restore CR
|
||||
rts
|
||||
|
||||
@ -63,10 +61,9 @@ crsroff lda conreg ; buffer CR
|
||||
+bank15
|
||||
jsr vpntcrsr ; set address
|
||||
lda tcolor ; get attribute
|
||||
- bit vdc ; get ready
|
||||
bpl -
|
||||
+wait_for_vdc
|
||||
sta reg ; set attribute
|
||||
.m=*+1: lda #MODIFIED8 ; bank
|
||||
.m = * + 1: lda #MODIFIED8 ; bank
|
||||
sta conreg ; restore CR
|
||||
rts
|
||||
|
||||
@ -74,9 +71,9 @@ crsroff lda conreg ; buffer CR
|
||||
!zone
|
||||
crsrnew ldx crsrheap ; get stackpointer
|
||||
lda vtemp ; get low
|
||||
sta crsrheap,x ; push
|
||||
lda vtemp+1 ; get high
|
||||
sta crsrheap+1,x; push
|
||||
sta crsrheap, x ; push
|
||||
lda vtemp + 1 ; get high
|
||||
sta crsrheap + 1, x ; push
|
||||
inx ; inc stackpointer
|
||||
inx
|
||||
stx crsrheap ; set stackpointer
|
||||
@ -84,7 +81,7 @@ crsrnew ldx crsrheap ; get stackpointer
|
||||
|
||||
!zone
|
||||
crsrhide ldx #$3f ; place cursor
|
||||
stx vtemp+1 ; outside visible
|
||||
stx vtemp + 1 ; outside visible
|
||||
ldx #$ff ; area
|
||||
stx vtemp
|
||||
rts
|
||||
@ -93,10 +90,10 @@ crsrhide ldx #$3f ; place cursor
|
||||
crsrold ldx crsrheap ; get stackpointer
|
||||
dex ; previous entry !
|
||||
dex
|
||||
lda crsrheap,x ; get lo
|
||||
lda crsrheap, x ; get lo
|
||||
sta vtemp ; set lo
|
||||
lda crsrheap+1,x; get hi
|
||||
sta vtemp+1 ; set hi
|
||||
lda crsrheap + 1, x ; get hi
|
||||
sta vtemp + 1 ; set hi
|
||||
stx crsrheap ; set stackpointer
|
||||
jmp crsron
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
;ACME 0.91
|
||||
;ACME 0.94.4
|
||||
|
||||
; ChangesNotSaved.Save?
|
||||
!zone
|
||||
willblost ldx changes
|
||||
bne +
|
||||
inx
|
||||
rts ; return with X=1 ("Changes safe, go on")
|
||||
inx
|
||||
rts ; return with X=1 ("Changes safe, go on")
|
||||
|
||||
+ jsr crsrnew
|
||||
ldx #hWindow_DCS
|
||||
@ -74,25 +74,25 @@ load lda conreg ; Bank sichern
|
||||
ldx #lf ; File: = Input
|
||||
jsr chkin
|
||||
ldy #$0f ; Header pruefen
|
||||
- jsr basin
|
||||
cmp idfile,y
|
||||
bne loadalien
|
||||
dey
|
||||
bpl -
|
||||
- jsr basin
|
||||
cmp idfile, y
|
||||
bne loadalien
|
||||
dey
|
||||
bpl -
|
||||
ldy #$0f ; Namen holen
|
||||
- jsr basin
|
||||
sta dosname,y
|
||||
dey
|
||||
bpl -
|
||||
- jsr basin
|
||||
sta dosname, y
|
||||
dey
|
||||
bpl -
|
||||
lda loadflag ; Bei LOAD
|
||||
bne loadfirst ; Name kopieren,
|
||||
sta unnamed ; (clear Flag)
|
||||
ldy #$0f
|
||||
- lda dosname,y
|
||||
sta txtname,y
|
||||
sta lodname,y
|
||||
dey
|
||||
bpl -
|
||||
- lda dosname, y
|
||||
sta txtname, y
|
||||
sta lodname, y
|
||||
dey
|
||||
bpl -
|
||||
sty updatewbi ; Update verlangen,
|
||||
jsr newtext ; Defaultwerte
|
||||
loadfirst ldy #FALSE ; Pufferstart
|
||||
@ -100,57 +100,57 @@ loadfirst ldy #FALSE ; Pufferstart
|
||||
|
||||
!zone
|
||||
loadline +xbank15
|
||||
- iny ; Eins weiter
|
||||
lda #" " ; get Space
|
||||
ldx status
|
||||
bne + ; ggfs
|
||||
jsr basin ; get Byte
|
||||
+ sta linebuf,y ; und setzen
|
||||
cpy llen
|
||||
bne -
|
||||
- iny ; Eins weiter
|
||||
lda #" " ; get Space
|
||||
ldx status
|
||||
bne + ; ggfs
|
||||
jsr basin ; get Byte
|
||||
+ sta linebuf, y ; und setzen
|
||||
cpy llen
|
||||
bne -
|
||||
ldy #1 ; Neustart
|
||||
- lda linebuf,y
|
||||
cmp #Char_RETURN
|
||||
beq ++
|
||||
cmp #"-"
|
||||
bne +
|
||||
sty linebuf ; Dann Pos merken
|
||||
+ cmp #" "
|
||||
bne +
|
||||
sty linebuf ; Dann Pos merken
|
||||
+ iny ; weiter
|
||||
cpy llen
|
||||
bne -
|
||||
lda linebuf,y ; LineEnd = Space ?
|
||||
- lda linebuf, y
|
||||
cmp #Char_RETURN
|
||||
beq ++
|
||||
cmp #"-"
|
||||
bne +
|
||||
sty linebuf ; Dann Pos merken
|
||||
+ cmp #" "
|
||||
bne +
|
||||
sty linebuf ; Dann Pos merken
|
||||
+ iny ; weiter
|
||||
cpy llen
|
||||
bne -
|
||||
lda linebuf, y ; LineEnd = Space ?
|
||||
cmp #" " ; Dann Grenze: = Y &
|
||||
bne +
|
||||
sty linebuf
|
||||
lda status
|
||||
beq + ; ggfs setflag
|
||||
sta eotflag
|
||||
sty linebuf
|
||||
lda status
|
||||
beq + ; ggfs setflag
|
||||
sta eotflag
|
||||
+ ldy linebuf ; get Grenze
|
||||
bne +
|
||||
ldy llen
|
||||
dey
|
||||
++ sty linebuf
|
||||
ldy llen
|
||||
dey
|
||||
++ sty linebuf
|
||||
+ +xram0
|
||||
jsr needline ; fordert Zeile
|
||||
bcs nomemleft ; ggfs Abbruch
|
||||
ldy linebuf ; copy buffer2line
|
||||
- lda linebuf,y
|
||||
sta (lvek),y
|
||||
dey
|
||||
bne -
|
||||
- lda linebuf, y
|
||||
sta (lvek), y
|
||||
dey
|
||||
bne -
|
||||
lda eotflag ; Ende ?
|
||||
bne endoffile
|
||||
ldx linebuf ; shift buffer
|
||||
- cpx llen ; fertig ?
|
||||
beq loadline ; Dann lesen !
|
||||
inx
|
||||
iny
|
||||
lda linebuf,x
|
||||
sta linebuf,y
|
||||
jmp -
|
||||
- cpx llen ; fertig ?
|
||||
beq loadline ; Dann lesen !
|
||||
inx
|
||||
iny
|
||||
lda linebuf, x
|
||||
sta linebuf, y
|
||||
jmp -
|
||||
|
||||
nomemleft jsr memfull ; Warnung
|
||||
endoffile +bank15
|
||||
@ -175,47 +175,47 @@ F_saveas jsr F_rnmtxt ; get Textname
|
||||
F_save lda unnamed ; Name ?
|
||||
bne F_saveas ; ggfs holen
|
||||
ldy #$0f ; proof "?"
|
||||
- lda txtname,y
|
||||
cmp #"?"
|
||||
beq F_saveas
|
||||
cmp #"*"
|
||||
beq F_saveas
|
||||
cmp #","
|
||||
beq F_saveas
|
||||
cmp #":"
|
||||
beq F_saveas
|
||||
sta dosname,y
|
||||
dey
|
||||
bpl -
|
||||
- lda txtname, y
|
||||
cmp #"?"
|
||||
beq F_saveas
|
||||
cmp #"*"
|
||||
beq F_saveas
|
||||
cmp #","
|
||||
beq F_saveas
|
||||
cmp #":"
|
||||
beq F_saveas
|
||||
sta dosname, y
|
||||
dey
|
||||
bpl -
|
||||
lda #"w" ; Schreibmodus
|
||||
sta dosmode
|
||||
lda conreg ; Bank sichern
|
||||
pha
|
||||
+bank15
|
||||
jsr crsrnew ; new copy (hidden)
|
||||
ldx #hWindow_Save; Save-Win
|
||||
ldx #hWindow_Save ; Save-Win
|
||||
stx menunr
|
||||
jsr makewin
|
||||
jsr copykill ; Killparameter
|
||||
jsr open ; Open CmdChannel
|
||||
lda killpara+1 ; (Scratch)
|
||||
lda killpara + 1 ; (Scratch)
|
||||
jsr close ; Close CC
|
||||
jsr copypara ; Dateiparameter
|
||||
jsr open ; Open Outputfile
|
||||
ldx #lf
|
||||
jsr chkout
|
||||
ldy #$0f ; Sendet Header
|
||||
- lda idfile,y
|
||||
jsr basout
|
||||
dey
|
||||
bpl -
|
||||
- lda idfile, y
|
||||
jsr basout
|
||||
dey
|
||||
bpl -
|
||||
ldy #$0f ; Sendet Name
|
||||
- lda txtname,y
|
||||
jsr basout
|
||||
dey
|
||||
bpl -
|
||||
- lda txtname, y
|
||||
jsr basout
|
||||
dey
|
||||
bpl -
|
||||
iny ; Y: = 0, tmpy wird fuers
|
||||
sty tmpy+1 ; Speichern init.
|
||||
sty tmpy + 1 ; Speichern init.
|
||||
tya ; A: = 0
|
||||
iny ; Y: = 1
|
||||
sty tmpy
|
||||
@ -223,45 +223,45 @@ F_save lda unnamed ; Name ?
|
||||
sbc zzbe ; Zeilenzaehler (tmp2)
|
||||
sta tmp2
|
||||
lda #0
|
||||
sbc zzbe+1
|
||||
sta tmp2+1
|
||||
-- +xram0 ; volles RAM
|
||||
ldx #1 ; mind. 1 Byte/Zeile
|
||||
stx linebuf
|
||||
ldx #TMP
|
||||
jsr getlvek ; LineVek
|
||||
ldy #1 ; Versatz: = 1
|
||||
- lda (lvek),y ; Byte in Puffer
|
||||
cmp #" "
|
||||
beq +
|
||||
sty linebuf ; Pos sichern
|
||||
+ sta linebuf,y
|
||||
iny
|
||||
cpy llen
|
||||
bne -
|
||||
ldx linebuf
|
||||
lda linebuf,x ; letztes Byte
|
||||
cmp #Char_RETURN
|
||||
beq +
|
||||
cmp #"-"
|
||||
beq +
|
||||
cmp #" "
|
||||
beq +
|
||||
inx ; Dann Space hinter
|
||||
lda #" " ; die Zeile
|
||||
sta linebuf,x
|
||||
+ stx .m ; Ende speichern
|
||||
+xbank15
|
||||
- inx ; X = 1
|
||||
lda linebuf,x ; Zeichen senden
|
||||
jsr basout
|
||||
.m=*+1: cpx #MODIFIED8 ; Länge
|
||||
bne - ; alle ?
|
||||
+inc16 tmpy ; tmpy += 1
|
||||
inc tmp2 ; zaehler += 1
|
||||
bne --
|
||||
inc tmp2+1
|
||||
bne --
|
||||
sbc zzbe + 1
|
||||
sta tmp2 + 1
|
||||
-- +xram0 ; volles RAM
|
||||
ldx #1 ; mind. 1 Byte/Zeile
|
||||
stx linebuf
|
||||
ldx #TMP
|
||||
jsr getlvek ; LineVek
|
||||
ldy #1 ; Versatz: = 1
|
||||
- lda (lvek), y ; Byte in Puffer
|
||||
cmp #" "
|
||||
beq +
|
||||
sty linebuf ; Pos sichern
|
||||
+ sta linebuf, y
|
||||
iny
|
||||
cpy llen
|
||||
bne -
|
||||
ldx linebuf
|
||||
lda linebuf, x ; letztes Byte
|
||||
cmp #Char_RETURN
|
||||
beq +
|
||||
cmp #"-"
|
||||
beq +
|
||||
cmp #" "
|
||||
beq +
|
||||
inx ; Dann Space hinter
|
||||
lda #" " ; die Zeile
|
||||
sta linebuf, x
|
||||
+ stx .m ; Ende speichern
|
||||
+xbank15
|
||||
- inx ; X = 1
|
||||
lda linebuf, x ; Zeichen senden
|
||||
jsr basout
|
||||
.m = * + 1: cpx #MODIFIED8 ; Länge
|
||||
bne - ; alle ?
|
||||
+inc16 tmpy ; tmpy += 1
|
||||
inc tmp2 ; zaehler += 1
|
||||
bne --
|
||||
inc tmp2 + 1
|
||||
bne --
|
||||
jsr clrchn ; Standardkanaele
|
||||
lda #lf
|
||||
jsr close ; Close File
|
||||
@ -278,9 +278,9 @@ copykill ldy #$0b ; Scratchparameter
|
||||
+bit16 ; BIT-Trick !
|
||||
copypara ldy #$05 ; Fileparameter
|
||||
ldx #5 ; 6 Bytes
|
||||
- lda filepara,y ; ins System
|
||||
sta fnlen,x
|
||||
dey
|
||||
dex
|
||||
bpl -
|
||||
- lda filepara, y ; ins System
|
||||
sta fnlen, x
|
||||
dey
|
||||
dex
|
||||
bpl -
|
||||
rts
|
||||
|
@ -1,4 +1,4 @@
|
||||
;ACME 0.91
|
||||
;ACME 0.94.4
|
||||
|
||||
!macro cmp16bit .data1, .data2 {
|
||||
ldx #.data1
|
||||
@ -53,20 +53,25 @@ CR_RAM0 = $3f
|
||||
}
|
||||
|
||||
!macro inc16x .a {
|
||||
inc .a,x
|
||||
inc .a, x
|
||||
bne +
|
||||
inc .a+1,x
|
||||
inc .a + 1, x
|
||||
+
|
||||
}
|
||||
|
||||
!macro ldax .a {
|
||||
lda .a+1
|
||||
lda .a + 1
|
||||
ldx .a
|
||||
}
|
||||
|
||||
!macro cp16 .s, .t {
|
||||
ldx .s
|
||||
lda .s+1
|
||||
lda .s + 1
|
||||
stx .t
|
||||
sta .t+1
|
||||
sta .t + 1
|
||||
}
|
||||
|
||||
!macro wait_for_vdc {
|
||||
- bit vdc
|
||||
bpl -
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
;ACME 0.91
|
||||
;ACME 0.94.4
|
||||
|
||||
; Vermerk:
|
||||
!text "MacEdit was written by Mac Bacon in 1994-97."
|
||||
@ -39,8 +39,8 @@ nwfrm !byte FALSE ; neues Bild ?
|
||||
blockflag !byte FALSE ; Block definiert ?
|
||||
wrapflag !byte TRUE ; PARWing ?
|
||||
esca !byte TRUE ; AutoInsert ?
|
||||
updatewbi !byte FALSE ; Flag-Redraw nötig ?
|
||||
repeatedtry !byte FALSE ; Schon früher gestartet ?
|
||||
updatewbi !byte FALSE ; Flag-Redraw nötig ?
|
||||
repeatedtry !byte FALSE ; Schon früher gestartet ?
|
||||
loadflag !byte 0 ; 0 = LOAD (/MERGE)
|
||||
txtname !text "unbenannt .txt"
|
||||
mrgname !text "merge .txt"
|
||||
|
@ -1,6 +1,6 @@
|
||||
;ACME 0.93
|
||||
!to "trigono.o", plain
|
||||
*=$c000
|
||||
* = $c000
|
||||
|
||||
PI = 3.14159265358979323846
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
!align $f, 0, 0 ; make output file look better in hex editor :)
|
||||
|
||||
!for x, 256 {
|
||||
!byte cos(float(x-1) / 255 * PI/2) * 255 + 0.5
|
||||
!byte cos(float(x - 1) / 255 * PI/2) * 255 + 0.5
|
||||
}
|
||||
; "x-1" converts interval [1,256] to interval [0,255]
|
||||
; "float()" makes sure this calculation is done in float mode now
|
||||
@ -22,7 +22,7 @@
|
||||
!align $f, 0, 0
|
||||
|
||||
!for x, 1024 {
|
||||
!32 sin(float(x-513) / 1024 * PI) * 65536 + 0.5
|
||||
!32 sin(float(x - 513) / 1024 * PI) * 65536 + 0.5
|
||||
}
|
||||
|
||||
;undefined = 0.0 / 0.0 ; throws error when active
|
||||
|
Loading…
Reference in New Issue
Block a user