From 0ec58e8b15aab41950e2e244526f506db7c8c0c9 Mon Sep 17 00:00:00 2001 From: marcobaye Date: Sun, 7 Apr 2013 21:29:09 +0000 Subject: [PATCH] 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 --- examples/ddrv.a | 354 ++++++++--------- examples/macedit.a | 30 +- examples/me/const.a | 84 ++-- examples/me/core.a | 472 +++++++++++----------- examples/me/cursor.a | 59 ++- examples/me/file.a | 246 ++++++------ examples/me/macros.a | 17 +- examples/me/out.a | 913 +++++++++++++++++++++---------------------- examples/me/vars.a | 6 +- examples/trigono.a | 6 +- 10 files changed, 1092 insertions(+), 1095 deletions(-) diff --git a/examples/ddrv.a b/examples/ddrv.a index fb36fb5..f5f42b8 100644 --- a/examples/ddrv.a +++ b/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<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 %###..................... diff --git a/examples/macedit.a b/examples/macedit.a index c4d1755..b72fa16 100644 --- a/examples/macedit.a +++ b/examples/macedit.a @@ -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 diff --git a/examples/me/const.a b/examples/me/const.a index aa79de3..e0478eb 100644 --- a/examples/me/const.a +++ b/examples/me/const.a @@ -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 diff --git a/examples/me/core.a b/examples/me/core.a index 0c0962c..352eda0 100644 --- a/examples/me/core.a +++ b/examples/me/core.a @@ -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 ++ ; anfend: 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 diff --git a/examples/me/cursor.a b/examples/me/cursor.a index e608802..38d4ffb 100644 --- a/examples/me/cursor.a +++ b/examples/me/cursor.a @@ -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 diff --git a/examples/me/file.a b/examples/me/file.a index 7e8536c..32de227 100644 --- a/examples/me/file.a +++ b/examples/me/file.a @@ -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 diff --git a/examples/me/macros.a b/examples/me/macros.a index d64cfc1..d186d88 100644 --- a/examples/me/macros.a +++ b/examples/me/macros.a @@ -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 - } diff --git a/examples/me/out.a b/examples/me/out.a index 30fd6d3..a446690 100644 --- a/examples/me/out.a +++ b/examples/me/out.a @@ -1,4 +1,4 @@ -;ACME 0.91 +;ACME 0.94.4 !zone F_info ldx #hWindow_InfoBox @@ -28,8 +28,8 @@ F_sw lda wrapflag ; Toggle Flag F_lfeed jsr poslvek ; LineVek jsr insert1 ; immer insert - lda #Char_RETURN; 'CR' an Cursorpos - sta (lvek),y + lda #Char_RETURN ; 'CR' an Cursorpos + sta (lvek), y sta nwfrm ; NewFrame fordern sta changes ; Veraendert ! jsr posparw ; PARW ? @@ -38,8 +38,8 @@ F_lfeed jsr poslvek ; LineVek beq poswrap ; Nein: Wrap lda posy ; Zeile in wrap sta wrpy - lda posy+1 - sta wrpy+1 + lda posy + 1 + sta wrpy + 1 jsr found ; und runterwrap rts @@ -56,25 +56,25 @@ cancelwrp jmp memfull ; Zeilen alle !zone poswrap ldx #POS stx xindex ; sichern - lda scry,x ; Zahl umkopieren + lda scry, x ; Zahl umkopieren sta wrpy - lda scry+1,x - sta wrpy+1 + lda scry + 1, x + sta wrpy + 1 jsr posparw ; PARW ? bcs proofparw ; Dann kein WRAP ldy llen ; LineEnd = Space ? - lda (lvek),y + lda (lvek), y cmp #" " beq proofparw ; Ja = > PARW -- dey ; sonst zurueck bis zu - beq linefull ; Space, "-", CR oder - lda (lvek),y ; LineStart (bekommt - cmp #" " ; Sonderbehandlung) - beq found - cmp #"-" - beq found - cmp #Char_RETURN - bne - +- dey ; sonst zurueck bis zu + beq linefull ; Space, "-", CR oder + lda (lvek), y ; LineStart (bekommt + cmp #" " ; Sonderbehandlung) + beq found + cmp #"-" + beq found + cmp #Char_RETURN + bne - !zone found sty wrpx ; puffert Y und addiert @@ -82,9 +82,9 @@ found sty wrpx ; puffert Y und addiert clc ; gut geshiftet wird adc lvek sta tmp2 - lda lvek+1 + lda lvek + 1 adc #0 - sta tmp2+1 + sta tmp2 + 1 lda llen ; errechnet Anzahl zu sec ; shiftender Bytes sbc wrpx ; als 'zahl' @@ -97,29 +97,29 @@ found sty wrpx ; puffert Y und addiert jsr rollfwd ldy zahl ; Anzahl Bytes ldx #" " ; Space -- lda (tmp2),y ; holt Byte und setzt - sta (lvek),y - txa ; loescht Quelle - sta (tmp2),y - dey - bne - +- lda (tmp2), y ; holt Byte und setzt + sta (lvek), y + txa ; loescht Quelle + sta (tmp2), y + dey + bne - ldx xindex ; errechnet neue - lda scrx,x ; Variablenwerte + lda scrx, x ; Variablenwerte sec ; Sind nur relevant, sbc wrpx ; wenn Location beq proofparw ; mitgewrapped wurde. bmi proofparw - sta scrx,x + sta scrx, x +inc16x scry !zone proofparw ldx wrapflag ; Wrap erlaubt ? beq + ; Nein = > Ende -.pl jsr incwrp ; naechste Zeile - ldx #WRP - jsr getlvek ; LineVek - jsr parw ; PARWen - bcs .pl ; ggfs Schleife +.pl jsr incwrp ; naechste Zeile + ldx #WRP + jsr getlvek ; LineVek + jsr parw ; PARWen + bcs .pl ; ggfs Schleife + ldx xindex ; Restore LineVek jsr getlvek rts @@ -133,9 +133,9 @@ posparw clc ldx #POS ; Cursor-Index lda wrapflag ; Wrap erlaubt ? beq + ; ggfs Ende - jsr parw ; PARWed - bcc + ; ggfs Variablen - jsr moveloc ; angleichen + jsr parw ; PARWed + bcc + ; ggfs Variablen + jsr moveloc ; angleichen + php ; C sichern ldx xindex ; Restore LineVek jsr getlvek @@ -151,36 +151,36 @@ parw stx xindex ; Sichert Index jsr cmp16bit bcc .no ; kleiner = > Abbruch ldx xindex ; X zurueck - lda scry+1,x ; holt Vektor und - ldy scry,x ; zaehlt runter + lda scry + 1, x ; holt Vektor und + ldy scry, x ; zaehlt runter bne + - sec - sbc #1 -+ sta prwy+1 ; Hi speichern + sec + sbc #1 ++ sta prwy + 1 ; Hi speichern dey ; Lo runter & speichern sty prwy ora prwy ; Vorige Zeile = 0 ? beq .no ; Dann Ende ! lda lvek ; lvek in tmp2 sta tmp2 - lda lvek+1 - sta tmp2+1 + lda lvek + 1 + sta tmp2 + 1 ldx #PRW ; lvek auf vorige Zeile jsr getlvek jsr findend ; sucht Zeilenende bne + ; Zeile leer ? - jsr delline ; loescht Zeile und - lda llen ; stellt Werte ein, - sta zahl ; die die Location - lda #0 ; entsprechend - sta prwx ; verschieben - sec ; C = 1 < = > gePARWt - rts -+ cmp #Char_RETURN; letztes Zeichen CR ? + jsr delline ; loescht Zeile und + lda llen ; stellt Werte ein, + sta zahl ; die die Location + lda #0 ; entsprechend + sta prwx ; verschieben + sec ; C = 1 < = > gePARWt + rts ++ cmp #Char_RETURN ; letztes Zeichen CR ? beq .no ; Dann Ende ! cmp #"-" beq + ; Dann kein Space - iny ; reservieren + iny ; reservieren + sty prwx ; Y auf LastByte lda llen ; errechnet Versatz, sec ; bei dem Suche @@ -191,25 +191,25 @@ parw stx xindex ; Sichert Index clc ; besser zu shiften adc lvek sta lvek - lda lvek+1 + lda lvek + 1 adc #0 - sta lvek+1 - lda (tmp2),y ; 1. Quellbyte holen -- cmp #" " - beq + - dey - beq .no ; LineStart = > Abbruch - lda (tmp2),y ; next Quellbyte - cmp #"-" - beq + - cmp #Char_RETURN - bne - + sta lvek + 1 + lda (tmp2), y ; 1. Quellbyte holen +- cmp #" " + beq + + dey + beq .no ; LineStart = > Abbruch + lda (tmp2),y ; next Quellbyte + cmp #"-" + beq + + cmp #Char_RETURN + bne - + sty zahl ; Anzahl sichern -- sta (lvek),y ; Zielbyte setzen - dey - beq + - lda (tmp2),y ; Quellbyte holen - jmp - ; Schleife +- sta (lvek), y ; Zielbyte setzen + dey + beq + + lda (tmp2), y ; Quellbyte holen + jmp - ; Schleife + lda llen ; Zeilenlaenge minus sec ; 'zahl' Bytes muessen sbc zahl ; noch shifted werden @@ -218,52 +218,51 @@ parw stx xindex ; Sichert Index clc ; wieder Vektor adc zahl ; aendern sta lvek - lda tmp2+1 + lda tmp2 + 1 adc #0 - sta lvek+1 + sta lvek + 1 ; Y noch 0 ! -- iny ; Y weiter - lda (lvek),y ; holt & setzt Byte - sta (tmp2),y -.m=*+1: cpy #MODIFIED8 ; Anzahl Bytes - bne - +- iny ; Y weiter + lda (lvek), y ; holt & setzt Byte + sta (tmp2), y +.m = * + 1: cpy #MODIFIED8 ; Anzahl Bytes + bne - lda #" " -- iny ; new line damit - sta (tmp2),y ; auffuellen - cpy llen ; bis Ende - bne - +- iny ; new line damit + sta (tmp2), y ; auffuellen + cpy llen ; bis Ende + bne - sec ; C = 1 < = > PARWed rts moveloc ldx xindex lda zahl ; X-Pos vor PARWgrenze? - cmp scrx,x + cmp scrx, x bcc inline ; Dann Pos += Anzahl clc - lda scrx,x + lda scrx, x adc prwx - sta scrx,x + sta scrx, x lda prwy ; verringerten Y-Wert - sta scry,x ; einkopieren - lda prwy+1 - sta scry+1,x + sta scry, x ; einkopieren + lda prwy + 1 + sta scry + 1, x sec ; C = 1 rts -inline lda scrx,x ; (C = 1) +inline lda scrx, x ; (C = 1) sbc zahl ; setzt Cursor zurueck adc #0 ; +Carry - sta scrx,x + sta scrx, x rts ; (C = 0) !zone findend ldy llen ; Versatz auf Ende -- lda (lvek),y ; holt Zeichen bis - cmp #" " ; Zeilenstart oder - bne endfound ; nicht-Space - dey - bne - - +- lda (lvek), y ; holt Zeichen bis + cmp #" " ; Zeilenstart oder + bne endfound ; nicht-Space + dey + bne - endfound rts ; Z = 1 = > Zeile leer (fixme - save a byte) ; Menuevariablen @@ -278,7 +277,7 @@ changewin beq lp19 ; kein Nachbar = > Ende tax ; prueft ob Menupunkt stx menunr ; beibehalten werden lda menupoint ; kann. Ggfs auf 1 - cmp winhe,x ; setzen + cmp winhe, x ; setzen bcc menuloop lda #1 sta menupoint @@ -299,20 +298,20 @@ lp19 jsr getchar ; Auf Zeichen warten ;beq mouselft ; => cmp #Char_CursorUp bne + - dey ; Punkt hoch & wech - jmp prfpoint + dey ; Punkt hoch & wech + jmp prfpoint + cmp #Char_CursorDown bne + - iny ; Punkt runter & wech - jmp prfpoint + iny ; Punkt runter & wech + jmp prfpoint + cmp #Char_CursorLeft bne + - lda lftwin,x ; Nachbar holen & wech - jmp changewin + lda lftwin, x ; Nachbar holen & wech + jmp changewin + cmp #Char_CursorRight bne + - lda rgtwin,x ; Nachbar holen & wech - jmp changewin + lda rgtwin, x ; Nachbar holen & wech + jmp changewin + cmp #Char_STOP bne lp19 ; Nein = > Schleife menuend jsr pullscr ; sonst restaurieren @@ -324,19 +323,19 @@ menucom pha ; CR/CS sichern, dazu pha ; und den Menupunkt tya pha - lda winadlo,x ; stellt Zeiger auf + lda winadlo, x ; stellt Zeiger auf sta tmp1 ; Menutexte - lda winadhi,x - sta tmp1+1 + lda winadhi, x + sta tmp1 + 1 ldy #0 ; Versatz Null jmp + ; in die Schleife -- iny ; naechstes Byte holen - lda (tmp1),y - bne - ; sucht Ende-Null - iny ; Versatz auf Command -+ lda (tmp1),y ; Command holen - dec menupoint ; richtiger Punkt ? - bne - ; Nein = > erneut +- iny ; naechstes Byte holen + lda (tmp1), y + bne - ; sucht Ende-Null + iny ; Versatz auf Command ++ lda (tmp1), y ; Command holen + dec menupoint ; richtiger Punkt ? + bne - ; Nein = > erneut tax ; Ja = > Command ! jsr execom jsr crsroff ; Sicherheitshalber... @@ -357,39 +356,38 @@ menucom pha ; CR/CS sichern, dazu !zone prfpoint tya ; Wenn Punkt = 0, bne ++ ; dann Punkt: = Letzter - ldy winhe,x - dey - jmp + - -++ cmp winhe,x ; Wenn Punkt zu gross, + ldy winhe, x + dey + jmp + +++ cmp winhe, x ; Wenn Punkt zu gross, bcc + ; dann Punkt: = 1 - ldy #1 -+ sty menupoint+1 ; neuen Punkt sichern - jsr calcpoint ; alten berechnen und - lda clrboxs ; mit WinFarbe faerben + ldy #1 ++ sty menupoint + 1 ; neuen Punkt sichern + jsr calcpoint ; alten berechnen und + lda clrboxs ; mit WinFarbe faerben jsr changeflg - ldy menupoint+1 ; neuen Punkt holen, - sty menupoint ; wird aktueller + ldy menupoint + 1 ; neuen Punkt holen, + sty menupoint ; wird aktueller jmp pointloop ; errechnet Adresse des Menupunkts !zone calcpoint ldx menunr ; holt Nummer & damit - lda winhi,x ; Screen-Addy - sta tmp1+1 ; Hi setzen - lda winlo,x + lda winhi, x ; Screen-Addy + sta tmp1 + 1 ; Hi setzen + lda winlo, x ldx menupoint ; holt Punkt sec ; +1 (Rand weg) -- adc #scrcols ; addiert Zeile - bcc + ; Page sichern - inc tmp1+1 - clc -+ dex ; ggfs - bne - ; Schleife +- adc #scrcols ; addiert Zeile + bcc + ; Page sichern + inc tmp1 + 1 + clc ++ dex ; ggfs + bne - ; Schleife sta tmp1 ; Lo setzen sec ; Erledigt Arbeit fuer ldx menunr ; aufrufende Routinen, - ldy winwi,x ; da X, Y, C richtig + ldy winwi, x ; da X, Y, C richtig dey ; belegt werden rts @@ -423,7 +421,7 @@ info !text 0,_,_,_,_,_,_,_,_, "---MacEdit---", 0 !text 0,_,_,_,_,_,_,_,_,_,_,_,_, "Mac",_, "Bacon/TekLords",0 !text 0,_,_,_,_,_, "Dies",_, "ist",_, "Freeware",_, "!",0 !byte 0, 0 - !text 0,_,_,_, "Bitte",_, "eine",_, "Taste",_, "dr",ü, "cken", 0 + !text 0,_,_,_, "Bitte",_, "eine",_, "Taste",_, "dr",ü, "cken", 0 datei !text $6f, "Neu", 0 !text $75, "Laden", 0 !text $76, "Nachladen", 0 @@ -453,7 +451,7 @@ nomem !byte 0 ; Auch 'hilfe'-Ende !text "---",_,_,_,_, "Achtung",_, "!",_,_,_, "---", 0 !text 0, "Der",_, "Speicher",_, "ist",_, "voll",_, "!", 0 !byte 0, 0 - !text 0, "Bitte",_, "eine",_, "Taste",_, "dr", ü, "cken" + !text 0, "Bitte",_, "eine",_, "Taste",_, "dr", ü, "cken" namewin !byte 0 ; Auch 'nomem'-Ende !text "Bitte",_, "Filenamen",_, "eingeben", 0 !byte 0, 0 @@ -461,7 +459,7 @@ namewin !byte 0 ; Auch 'nomem'-Ende !byte 0 ; Rest unten dcswin !byte 0, 0 ; Auch fuer 'namewin' !byte 0 ; Auch fuer 'namewin' - !text _,_, "Ungespeicherte",_, Ä, "nderungen",_, "!",_,_, 0 + !text _,_, "Ungespeicherte",_, Ä, "nderungen",_, "!",_,_, 0 !byte 0, 0 !byte 0, 0 !text 0,_, "[DEL]",_,_,_,_, "Verwerfen...", 0 @@ -491,15 +489,15 @@ swin !byte 0 ; Auch fuer 'lwin' !zone init ldx repeatedtry ; first start ? bne + - sta repeatedtry + sta repeatedtry + tsx ; buffer stack, bank & stx stck ; NMI for end ldx conreg stx bank ldy nmivek - ldx nmivek+1 + ldx nmivek + 1 sty nmibuf - stx nmibuf+1 + stx nmibuf + 1 +xbank15 inx ; X = 1 => 2 MHz stx takt @@ -514,7 +512,7 @@ init ldx repeatedtry ; first start ? stx $11e7 lda mode ; which mode ? bmi + ; if 40 then - jsr kernel_switchmode; switch mode + jsr kernel_switchmode ; switch mode + lda #111 ; DIN on sta D8502 lda #%..##..## @@ -522,21 +520,21 @@ init ldx repeatedtry ; first start ? jsr kernel_copyfont lda #47 ; DIN off sta D8502 - lda #addfont1_start - sta tmp1+1 - lda #>addfont1_target; Hi - ldx #addfont1_target ; Hi + ldx #addfont2_start - sta tmp1+1 - lda #>addfont2_target; Hi - ldx #addfont2_target ; Hi + ldx #nmirtn sta nmivek - stx nmivek+1 - sta conreg+1 ; full RAM + stx nmivek + 1 + sta conreg + 1 ; full RAM ldx #$0b ; loop for new -- lda keyb,x ; keyboard-tabs - sta $033e,x - dex - bpl - +- lda keyb, x ; keyboard-tabs + sta $033e, x + dex + bpl - jsr handleid ; old ID ? bcc + ; then ok ! - jsr fillmem ; else fill memory - jsr newtext ; defaults - jsr needline ; wanting line - ldx #FALSE - stx changes + jsr fillmem ; else fill memory + jsr newtext ; defaults + jsr needline ; wanting line + ldx #FALSE + stx changes + jsr F_info ; credits lda #TRUE ; update screen sta nwfrm sta updatewbi ; update flags ldx repeatedtry ; first start ? bne + ; then load defaulttext - dec repeatedtry - jsr load + dec repeatedtry + jsr load + jmp mainloop -addfont1_target=$35f1 +addfont1_target = $35f1 addfont1_start !byte %.####### !byte %.#####.# @@ -731,7 +728,7 @@ addfont1_start !byte %....#... !byte %....#... addfont1_end -addfont2_target=$3ff0 +addfont2_target = $3ff0 addfont2_start !byte %........ !byte %........ @@ -753,9 +750,9 @@ F_gosys +bank15 sta $0ac5 ; 'ASC/DIN' on sta basic ; 'Basic-IRQ' on lda nmibuf ; restore NMI - ldx nmibuf+1 + ldx nmibuf + 1 sta nmivek - stx nmivek+1 + stx nmivek + 1 ldx bank ; restore bank & stack stx conreg ldx stck @@ -771,7 +768,7 @@ newframe +ybank15 lda #scrhi ; textstart on screen ldx #scrlo jsr ramaccess ; set vdc - sty conreg+1 ; full RAM + sty conreg + 1 ; full RAM ldx #SCR jsr getvvek ; set VekVek stx nwfrm ; clear jobflag @@ -779,10 +776,10 @@ newframe +ybank15 sec ; screen ? sbc scry ; calculates both tay ; numbers - lda zzbe+1 - sbc scry+1 + lda zzbe + 1 + sbc scry + 1 bne bigtext - cpy #scrlins-1 + cpy #scrlins - 1 bcs bigtext iny ; Base 1 sty .m1 @@ -794,42 +791,40 @@ newframe +ybank15 !zone m61 sta tmp2 ; Leerzeilen sty line ; zu zeigende Zeilen ---- ldy #0 ; Low-Byte - lda (vvek),y ; holen - sta lvek ; & speichern - iny ; High-Byte - lda (vvek),y ; holen - sta lvek+1 ; & speichern - lda #scrcols ; darzustellende - sta col ; Spalten - ldy scrx ; x-Versatz holen --- lda (lvek),y ; Zeichen holen - +xbank15 - tax ; & in Screencode - lda atst,x ; konvertieren -- bit vdc ; get ready - bpl - - sta reg ; in VDC - sta conreg+1 ; full RAM - iny ; Versatz erhoehen - dec col ; naechste Spalte - bne -- ; schon alle = > - inc vvek ; naechster Vektor (2 Byte !) - +inc16 vvek - dec line ; naechste Zeile - bne --- ; schon alle ? = > +-- ldy #0 ; Low-Byte + lda (vvek), y ; holen + sta lvek ; & speichern + iny ; High-Byte + lda (vvek), y ; holen + sta lvek + 1 ; & speichern + lda #scrcols ; darzustellende + sta col ; Spalten + ldy scrx ; x-Versatz holen +- lda (lvek), y ; Zeichen holen + +xbank15 + tax ; & in Screencode + lda atst,x ; konvertieren + +wait_for_vdc + sta reg ; in VDC + sta conreg + 1 ; full RAM + iny ; Versatz erhoehen + dec col ; naechste Spalte + bne - ; schon alle = > + inc vvek ; naechster Vektor (2 Byte !) + +inc16 vvek + dec line ; naechste Zeile + bne -- ; schon alle ? = > +bank15 lda #" " --- dec tmp2 ; Anzahl runter - bmi + ; ggfs Ende - ldy #scrcols ; Spaltenzahl -- bit vdc ; get ready - bpl - - sta reg ; Space setzen - dey ; alle Spalten ? - bne - - jmp -- -+ sta conreg+1 ; full RAM +-- dec tmp2 ; Anzahl runter + bmi + ; ggfs Ende + ldy #scrcols ; Spaltenzahl +- +wait_for_vdc + sta reg ; Space setzen + dey ; alle Spalten ? + bne - + jmp -- ++ sta conreg + 1 ; full RAM rts ; Folgende Routine aendert ScreenFlag, @@ -840,31 +835,30 @@ m61 sta tmp2 ; Leerzeilen ; Einsprung changeflg: ;-Y = Laenge ;-tmp1 = Vektor auf Position -setflagdata ldy flgadr,x ; Setzt Adresse (Lo) +setflagdata ldy flgadr, x ; Setzt Adresse (Lo) sty tmp1 ldy #scrhi - sty tmp1+1 - ldy flglen,x ; Holt Laenge + sty tmp1 + 1 + ldy flglen, x ; Holt Laenge !zone changeflg sta .m3 ; buffer color sty .m2 ; buffer length - lda #attrhi-scrhi + lda #attrhi - scrhi clc ; bend vector to - adc tmp1+1 ; attributes - sta tmp1+1 + adc tmp1 + 1 ; attributes + sta tmp1 + 1 ldy conreg ; buffer bank sty .m1 +ybank15 jsr tmpaccess ; set vdc -.m3=*+1: lda #MODIFIED8 ; attribute -.m2=*+1: ldy #MODIFIED8 ; length -- bit vdc ; get ready - bpl - - sta reg ; set attributes - dey ; count - bne - -.m1=*+1: ldy #MODIFIED8 ; bank +.m3 = * + 1: lda #MODIFIED8 ; attribute +.m2 = * + 1: ldy #MODIFIED8 ; length +- +wait_for_vdc + sta reg ; set attributes + dey ; count + bne - +.m1 = * + 1: ldy #MODIFIED8 ; bank sty conreg rts @@ -883,23 +877,23 @@ flglen !byte 6, 10, 10, 10, 10, 10, 10, 1, 1, 1 showwbi lda clraktv ; Aktiv-Farbe ldy wrapflag ; Flag pruefen bne + ; ggfs andere Farbe - lda clrinak + lda clrinak + ldx #hFlag_Wrap jsr setflagdata ; Farbe setzen lda clraktv ; Ab hier Wiederholung ldy beep beq + - lda clrinak + lda clrinak + ldx #hFlag_Beep jsr setflagdata lda clraktv ldy esca bne + - lda clrinak + lda clrinak + ldx #hFlag_Insert jsr setflagdata lda #>txtname ; set vector - sta tmp1+1 + sta tmp1 + 1 lda #flnmpos ; show filename @@ -918,14 +912,13 @@ ram2vdc sta vimm4 ; buffer all ram2vdc1 lda conreg ; buffer bank sta .m1 jsr vdcprep ; prepare vdc --- iny ; next - lda (tmp1),y ; get byte -- bit vdc ; get ready - bpl - - sta reg ; set byte -.m2=*+1: cpy #MODIFIED8 ; length - bne -- -.m1=*+1: lda #MODIFIED8 ; bank +- iny ; next + lda (tmp1), y ; get byte + +wait_for_vdc + sta reg ; set byte +.m2 = * + 1: cpy #MODIFIED8 ; length + bne - +.m1 = * + 1: lda #MODIFIED8 ; bank sta conreg rts @@ -937,24 +930,23 @@ copystr sta vimm4 ; buffer all copystr1 lda conreg ; buffer bank sta .m1 jsr vdcprep ; prepare vdc --- iny ; next - lda (tmp1),y ; get byte - tax ; convert - lda atst,x -- bit vdc ; get ready - bpl - - sta reg ; set byte -vimm6=*+1: cpy #MODIFIED8 ; length - bne -- -.m1=*+1: lda #MODIFIED8 ; bank +- iny ; next + lda (tmp1), y ; get byte + tax ; convert + lda atst, x + +wait_for_vdc + sta reg ; set byte +vimm6 = * + 1: cpy #MODIFIED8 ; length + bne - +.m1 = * + 1: lda #MODIFIED8 ; bank sta conreg rts ; preparations for ram2vdc & copystr !zone vdcprep +bank15 -vimm4=*+1: lda #MODIFIED8 ; High -vimm5=*+1: ldx #MODIFIED8 ; Low +vimm4 = * + 1: lda #MODIFIED8 ; High +vimm5 = * + 1: ldx #MODIFIED8 ; Low jsr ramaccess ldy #$ff ; pre-index rts @@ -968,11 +960,11 @@ F_rnmtxt rename pha ; sichert Namepointer tay ldx #$0f ; copy Filename -- lda txtname,y - sta dosname,x - dey - dex - bpl - +- lda txtname, y + sta dosname, x + dey + dex + bpl - lda conreg ; Bank sichern pha +ram0io @@ -988,77 +980,77 @@ rename pha ; sichert Namepointer adc #3 ; +4 (C = 1) sta vimm5 ; set Lo bcc + - inc tmp1+1 -+ lda tmp1+1 + inc tmp1 + 1 ++ lda tmp1 + 1 sta vimm4 ; set Hi ldy #dosname - sty tmp1+1 + sty tmp1 + 1 ldy #$0f ; set length sty vimm6 !zone showname jsr copystr1 ; show name --- ldy #9 ; Y- und X-Wert - lda xpos ; errechnen - clc - adc #$20 - jsr crsrset ; Cursor setzen -- jsr getchar ; Byte holen und - tax ; sichern - and #%.##..... ; Command ? - beq + ; ggfs => - eor #%.##..... - beq + - lda esca ; AutoInsert ? - beq ++ ; ggfs - jsr einf1 ; insert -++ txa ; Zeichen an Position - ldy xpos ; setzen - sta dosname,y - jsr rechts1 ; eins rechts - jmp showname -+ txa ; Byte holen - cmp #Char_CursorRight - beq rechts - cmp #Char_CursorLeft - beq links - cmp #Char_DEL - beq back - cmp #CharOwn_Delete - beq dele - cmp #Char_INST - beq einf - cmp #Char_RETURN - beq + - cmp #Char_STOP - bne - ; Nein = > - lda #0 ; Stop- -+ sta xpos ; Flag sichern - jsr pullscr ; Window weg - jsr crsrold ; old copy - pla ; alte Bank - sta conreg - pla ; Y: = Namepointer - tay - lda xpos ; STOP ? - beq .noname ; Nein: Namen kopieren - ldx #$0f -- lda dosname,x - sta txtname,y - dey - dex - bpl - - lda #TRUE ; und Update fordern - sta updatewbi -.noname rts ; Z = Stopflag -rechts jsr rechts1 ; Eins weiter - jmp -- -links jsr links1 ; Eins zurück - jmp -- -back jsr links1 ; Erst zurück, dann -dele jsr dele1 ; löschen +-- ldy #9 ; Y- und X-Wert + lda xpos ; errechnen + clc + adc #$20 + jsr crsrset ; Cursor setzen +- jsr getchar ; Byte holen und + tax ; sichern + and #%.##..... ; Command ? + beq + ; ggfs => + eor #%.##..... + beq + + lda esca ; AutoInsert ? + beq ++ ; ggfs + jsr einf1 ; insert +++ txa ; Zeichen an Position + ldy xpos ; setzen + sta dosname, y + jsr rechts1 ; eins rechts + jmp showname ++ txa ; Byte holen + cmp #Char_CursorRight + beq rechts + cmp #Char_CursorLeft + beq links + cmp #Char_DEL + beq back + cmp #CharOwn_Delete + beq dele + cmp #Char_INST + beq einf + cmp #Char_RETURN + beq + + cmp #Char_STOP + bne - ; Nein = > + lda #0 ; Stop- ++ sta xpos ; Flag sichern + jsr pullscr ; Window weg + jsr crsrold ; old copy + pla ; alte Bank + sta conreg + pla ; Y: = Namepointer + tay + lda xpos ; STOP ? + beq .noname ; Nein: Namen kopieren + ldx #$0f +- lda dosname, x + sta txtname, y + dey + dex + bpl - + lda #TRUE ; und Update fordern + sta updatewbi +.noname rts ; Z = Stopflag +rechts jsr rechts1 ; Eins weiter + jmp -- +links jsr links1 ; Eins zurück + jmp -- +back jsr links1 ; Erst zurück, dann +dele jsr dele1 ; löschen jmp showname einf jsr einf1 ; Eins freimachen jmp showname @@ -1067,40 +1059,40 @@ einf jsr einf1 ; Eins freimachen rechts1 inc xpos ; Pos += 1 & pruefen jmp + -links1 dec xpos ; Pos- = 1 & pruefen -+ lda xpos ; Negativ ? +links1 dec xpos ; Pos- = 1 & pruefen ++ lda xpos ; Negativ ? bpl + - lda #0 ; Dann Pos 0 -+ cmp #$0c ; Ende ? + lda #0 ; Dann Pos 0 ++ cmp #$0c ; Ende ? bcc + - lda #$0b ; Dann zum Rand -+ sta xpos ; Pos setzen + lda #$0b ; Dann zum Rand ++ sta xpos ; Pos setzen rts !zone dele1 ldy xpos ; Start bei Cursor -- cpy #$0b ; schon am Rand ? - beq + ; Dann Ende ! - lda dosname+1,y ; Sonst shiften - sta dosname,y - iny - jmp - +- cpy #$0b ; schon am Rand ? + beq + ; Dann Ende ! + lda dosname + 1, y ; Sonst shiften + sta dosname, y + iny + jmp - + lda #" " ; Space setzen - sta dosname,y + sta dosname, y rts !zone einf1 ldy #$0b ; Start am Rand -- cpy xpos ; schon fertig ? - beq + ; Ja = > - lda dosname-1,y ; Zeichen shiften - sta dosname,y - dey - jmp - +- cpy xpos ; schon fertig ? + beq + ; Ja = > + lda dosname - 1, y ; Zeichen shiften + sta dosname, y + dey + jmp - + lda #" " ; Space an Pos - sta dosname,y + sta dosname, y rts !zone @@ -1113,8 +1105,7 @@ wsold +ldax wsback + ldy #24 ; VDC (Vscroll) sty vdc ldy #$a0 ; 'block-copy' -- bit vdc ; get ready - bpl - + +wait_for_vdc sty reg ; set jmp ramaccess @@ -1127,13 +1118,13 @@ makewin inc manywins ; eins mehr ! +ram0io ldx menunr ; Holt Nummer beq + ; Ist das Window ein - cpx #hWindow_FirstAfterMenu ; Menu-Window, wird - bcs + ; das Flag aktiviert - lda clrmenu1 - jsr setflagdata + cpx #hWindow_FirstAfterMenu ; Menu-Window, wird + bcs + ; das Flag aktiviert + lda clrmenu1 + jsr setflagdata + jsr wsnew ; macht VDC zum Stack - ldy wsback+1 ; alter end-pointer - sta wsback+1 ; wird zu neuem + ldy wsback + 1 ; alter end-pointer + sta wsback + 1 ; wird zu neuem lda wsback ; last-pointer stx wsback jsr stashbt ; buffer last pointer @@ -1142,32 +1133,32 @@ makewin inc manywins ; eins mehr ! ldx menunr ; get Win-Nr txa jsr stashbt ; wird gestacked - lda winlo,x ; Holt mit X die + lda winlo, x ; Holt mit X die sta tmp1 ; anderen Parameter sta tmp2 - lda winhi,x - sta tmp1+1 + lda winhi, x + sta tmp1 + 1 clc - adc #attrhi-scrhi - sta tmp2+1 - ldy winwi,x ; get width + adc #attrhi - scrhi + sta tmp2 + 1 + ldy winwi, x ; get width sty .m1 ; for colorate iny ; convert sty mWidth ; for push - lda winclr,x ; get colorcode + lda winclr, x ; get colorcode tay ; convert - lda clrboxs,y ; get color + lda clrboxs, y ; get color sta .m2 ; in Immediate jsr scrn2stck ; push chars lda tmp2 ; attrib-vector sta tmp1 - lda tmp2+1 - sta tmp1+1 + lda tmp2 + 1 + sta tmp1 + 1 jsr scrn2stck ; push attributes ldy #18 ; VDC (access Hi) sty vdc jsr fetchbt ; get pointerHi - sta wspntr+1 ; set pointerHi + sta wspntr + 1 ; set pointerHi iny ; VDC (access Lo) sty vdc jsr fetchbt ; get pointerLo @@ -1177,38 +1168,38 @@ makewin inc manywins ; eins mehr ! sty vdc lda #$20 ; 'block-write' jsr stashbt - lda winhe,x ; get height + lda winhe, x ; get height sta line -- +ldax tmp2 ; get target - jsr ramaccess ; set vdc -.m2=*+1: lda #MODIFIED8 ; attribute - jsr stashbt ; set attribute - dey ; VDC (counter) - sty vdc -.m1=*+1: lda #MODIFIED8 ; width - jsr stashbt ; start write - lda #scrcols ; address for next row - clc - adc tmp2 - sta tmp2 - bcc + - inc tmp2+1 -+ dec line ; alle Zeilen ? - bpl - ; Nein = > +- +ldax tmp2 ; get target + jsr ramaccess ; set vdc +.m2 = * + 1: lda #MODIFIED8 ; attribute + jsr stashbt ; set attribute + dey ; VDC (counter) + sty vdc +.m1 = * + 1: lda #MODIFIED8 ; width + jsr stashbt ; start write + lda #scrcols ; address for next row + clc + adc tmp2 + sta tmp2 + bcc + + inc tmp2 + 1 ++ dec line ; alle Zeilen ? + bpl - ; Nein = > ; bisher Backup und Faerben, jetzt Win ldx menunr ; get Win-Nr - lda winlo,x ; get location, width, + lda winlo, x ; get location, width, sta tmp1 ; heigth & textvector - lda winhi,x - sta tmp1+1 - lda winwi,x + lda winhi, x + sta tmp1 + 1 + lda winwi, x sta col - lda winhe,x + lda winhe, x sta line - lda winadlo,x + lda winadlo, x sta tmp2 - lda winadhi,x - sta tmp2+1 + lda winadhi, x + sta tmp2 + 1 ; hier oberer Rand jsr tmpaccess ; set vdc ldx col ; get width & @@ -1216,9 +1207,9 @@ makewin inc manywins ; eins mehr ! lda #chrol ; 'Oben Links' jsr stashbt ; set lda #chroo ; 'Oben' -- jsr stashbt ; set - dex - bne - +- jsr stashbt ; set + dex + bne - lda #chror ; 'Oben Rechts' jsr stashbt ; set dec line ; naechste Zeile @@ -1228,26 +1219,26 @@ makewin inc manywins ; eins mehr ! adc tmp1 ; naechste Zeile sta tmp1 ; um bcc + - inc tmp1+1 + inc tmp1 + 1 + jsr tmpaccess ; set vdc ldy #1 ; textindex 1 lda #chrll ; 'Links' jsr stashbt ; set -- lda (tmp2),y ; get char - beq + ; end ? if not then - tax ; convert to screencode - lda atst,x - jsr stashbt ; output - iny ; next column - jmp - +- lda (tmp2), y ; get char + beq + ; end ? if not then + tax ; convert to screencode + lda atst, x + jsr stashbt ; output + iny ; next column + jmp - + tya ; if string has ended then tax ; remember memory offset in x -- cpy col ; finished ? - beq + ; if not then - lda #chrmm ; output inner space - jsr stashbt - iny ; next column - jmp - +- cpy col ; finished ? + beq + ; if not then + lda #chrmm ; output inner space + jsr stashbt + iny ; next column + jmp - + lda #chrrr ; when finished, output right border jsr stashbt txa ; calculate new memory pointer @@ -1255,7 +1246,7 @@ makewin inc manywins ; eins mehr ! adc tmp2 ; line sta tmp2 bcc + - inc tmp2+1 + inc tmp2 + 1 + dec line ; schon alle Zeilen ? bne .field ; ggfs Schleife ; jetzt der Unterrand @@ -1264,16 +1255,16 @@ makewin inc manywins ; eins mehr ! adc tmp1 sta tmp1 bcc + - inc tmp1+1 + inc tmp1 + 1 + jsr tmpaccess ; set vdc ldx col ; get width & dex ; convert lda #chrul ; 'Unten Links' jsr stashbt ; set lda #chruu ; 'Unten' -- jsr stashbt ; set - dex - bne - +- jsr stashbt ; set + dex + bne - lda #chrur ; 'Unten Rechts' jsr stashbt ; set pla ; alte Bank @@ -1293,28 +1284,28 @@ winlo !byte 152, 80, 92, 104, 116, 128, 140, 235, 235, 151, 146, 144 winhi !byte 2, 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, 3 !zone -scrn2stck lda winhe,x ; get height +scrn2stck lda winhe, x ; get height sta line -- ldy #32 ; VDC (source Hi) - sty vdc - lda tmp1+1 - jsr stashbt ; set sourceHi - iny ; VDC (source Lo) - sty vdc - lda tmp1 - jsr stashbt ; set sourceLo - ldy #30 ; VDC (counter) - sty vdc -mWidth=*+1: lda #MODIFIED8 ; width - jsr stashbt ; start copy - lda #scrcols ; address for next row - clc - adc tmp1 - sta tmp1 - bcc + - inc tmp1+1 -+ dec line ; alle Zeilen ? - bpl - ; Nein = > +- ldy #32 ; VDC (source Hi) + sty vdc + lda tmp1 + 1 + jsr stashbt ; set sourceHi + iny ; VDC (source Lo) + sty vdc + lda tmp1 + jsr stashbt ; set sourceLo + ldy #30 ; VDC (counter) + sty vdc +mWidth = * + 1: lda #MODIFIED8 ; width + jsr stashbt ; start copy + lda #scrcols ; address for next row + clc + adc tmp1 + sta tmp1 + bcc + + inc tmp1 + 1 ++ dec line ; alle Zeilen ? + bpl - ; Nein = > rts !zone @@ -1322,23 +1313,23 @@ pullscr lda conreg ; Bank sichern pha +ram0io jsr wsold ; init stack for read - sta wspntr+1 ; new write-start + sta wspntr + 1 ; new write-start stx wspntr ; new write-start jsr fetchbt ; get old laststart sta wsback ; and use jsr fetchbt - sta wsback+1 + sta wsback + 1 jsr fetchbt ; get handle from stack tax - lda winlo,x ; Holt mit X die + lda winlo, x ; Holt mit X die sta tmp1 ; anderen Parameter sta tmp2 - lda winhi,x - sta tmp1+1 + lda winhi, x + sta tmp1 + 1 clc - adc #attrhi-scrhi - sta tmp2+1 - ldy winwi,x ; get width + adc #attrhi - scrhi + sta tmp2 + 1 + ldy winwi, x ; get width iny ; convert sty .m1 ldy #18 ; VDC (access Hi) @@ -1356,41 +1347,41 @@ pullscr lda conreg ; Bank sichern jsr stck2scrn ; pull chars lda tmp2 ; attrib-vector sta tmp1 - lda tmp2+1 - sta tmp1+1 + lda tmp2 + 1 + sta tmp1 + 1 jsr stck2scrn ; pull attributes txa ; if menu-window, beq + ; then deactivate flag - cmp #7 - bcs + - lda clrmenu - jsr setflagdata + cmp #7 + bcs + + lda clrmenu + jsr setflagdata + dec manywins ; minus one win pla ; restore bank sta conreg rts -stck2scrn lda winhe,x ; get height +stck2scrn lda winhe, x ; get height sta line -- ldy #18 ; VDC (access Hi) - sty vdc - lda tmp1+1 - jsr stashbt ; set targetHi - iny ; VDC (access Lo) - sty vdc - lda tmp1 - jsr stashbt ; set targetLo - ldy #30 ; VDC (counter) - sty vdc -.m1=*+1: lda #MODIFIED8 ; width - jsr stashbt ; start copy - lda #scrcols ; address for next row - clc - adc tmp1 - sta tmp1 - bcc + - inc tmp1+1 -+ dec line ; alle Zeilen ? - bpl - ; Nein = > +- ldy #18 ; VDC (access Hi) + sty vdc + lda tmp1 + 1 + jsr stashbt ; set targetHi + iny ; VDC (access Lo) + sty vdc + lda tmp1 + jsr stashbt ; set targetLo + ldy #30 ; VDC (counter) + sty vdc +.m1 = * + 1: lda #MODIFIED8 ; width + jsr stashbt ; start copy + lda #scrcols ; address for next row + clc + adc tmp1 + sta tmp1 + bcc + + inc tmp1 + 1 ++ dec line ; alle Zeilen ? + bpl - ; Nein = > rts wspntr !word wsstart ; win-stackpointer @@ -1399,7 +1390,7 @@ wsback !word wsstart ; last pointer F_menu lda #wsstart - sta wspntr+1 + sta wspntr + 1 jsr crsrnew ; new copy ldx #0 ; yet no windows stx manywins @@ -1416,24 +1407,20 @@ tmpaccess +ldax tmp1 !zone ramaccess ldy #18 ; VDC (access Hi) sty vdc -- bit vdc ; get ready - bpl - + +wait_for_vdc sta reg ; set Hi iny ; VDC (access Lo) sty vdc -- bit vdc ; get ready - bpl - + +wait_for_vdc stx reg ; set Lo ldy #31 ; VDC (ram data) sty vdc rts -fetchbt bit vdc ; get ready - bpl fetchbt +fetchbt +wait_for_vdc lda reg ; fetch byte rts -stashbt bit vdc ; get ready - bpl stashbt +stashbt +wait_for_vdc sta reg ; stash byte rts diff --git a/examples/me/vars.a b/examples/me/vars.a index eec4089..0d11f8f 100644 --- a/examples/me/vars.a +++ b/examples/me/vars.a @@ -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" diff --git a/examples/trigono.a b/examples/trigono.a index c832199..4e3508d 100644 --- a/examples/trigono.a +++ b/examples/trigono.a @@ -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