Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #3302 > unrolled thread

running programs in aux memory

Started byMark Lemmert <mark.lemmert@gmail.com>
First post2017-03-02 12:10 -0800
Last post2017-03-08 17:04 -0800
Articles 7 on this page of 27 — 11 participants

Back to article view | Back to comp.sys.apple2.programmer


Contents

  running programs in aux memory Mark Lemmert <mark.lemmert@gmail.com> - 2017-03-02 12:10 -0800
    Re: running programs in aux memory "Mark D. Overholser" <marko@markoverholser.com> - 2017-03-02 14:18 -0800
      Re: running programs in aux memory Mark Lemmert <mark.lemmert@gmail.com> - 2017-03-03 11:08 -0800
    Re: running programs in aux memory roger.shimada@gmail.com - 2017-03-02 20:41 -0800
      Re: running programs in aux memory Mark Lemmert <mark.lemmert@gmail.com> - 2017-03-03 11:18 -0800
        Re: running programs in aux memory roger.shimada@gmail.com - 2017-03-05 09:13 -0800
          Re: running programs in aux memory 6502workshop@gmail.com - 2017-03-05 20:11 -0800
    Re: running programs in aux memory gids.rs@sasktel.net - 2017-03-03 00:50 -0800
      Re: running programs in aux memory qkumba <peter.ferrie@gmail.com> - 2017-03-03 08:47 -0800
        Re: running programs in aux memory Mark Lemmert <mark.lemmert@gmail.com> - 2017-03-03 11:08 -0800
          Re: running programs in aux memory gids.rs@sasktel.net - 2017-03-03 12:55 -0800
            Re: running programs in aux memory gids.rs@sasktel.net - 2017-03-03 13:00 -0800
              Re: running programs in aux memory Antoine Vignau <antoine.vignau@laposte.net> - 2017-03-03 19:53 -0800
                Re: running programs in aux memory gids.rs@sasktel.net - 2017-03-03 20:41 -0800
                  Re: running programs in aux memory qkumba <peter.ferrie@gmail.com> - 2017-03-03 21:43 -0800
                    Re: running programs in aux memory gids.rs@sasktel.net - 2017-03-04 08:37 -0800
                      Re: running programs in aux memory Antoine Vignau <antoine.vignau@laposte.net> - 2017-03-04 11:02 -0800
                        Re: running programs in aux memory gids.rs@sasktel.net - 2017-03-04 13:54 -0800
                        Re: running programs in aux memory gids.rs@sasktel.net - 2017-03-05 15:58 -0800
                          Re: running programs in aux memory John Brooks <jbrooks@blueshiftinc.com> - 2017-03-05 20:16 -0800
                            Re: running programs in aux memory qkumba <peter.ferrie@gmail.com> - 2017-03-06 09:30 -0800
                      Re: running programs in aux memory qkumba <peter.ferrie@gmail.com> - 2017-03-04 22:11 -0800
              Re: running programs in aux memory Michael Pohoreski <michael.pohoreski@gmail.com> - 2017-03-15 19:06 -0700
      Re: running programs in aux memory Benoit0123 <bgilon@free.fr> - 2017-03-06 00:20 +0000
    Re: running programs in aux memory 6502workshop@gmail.com - 2017-03-05 20:13 -0800
    Re: running programs in aux memory laseractiveguy@gmail.com - 2017-03-08 16:33 -0800
    Re: running programs in aux memory laseractiveguy@gmail.com - 2017-03-08 17:04 -0800

Page 2 of 2 — ← Prev page 1 [2]


#3335

Fromqkumba <peter.ferrie@gmail.com>
Date2017-03-06 09:30 -0800
Message-ID<10c48006-30a9-4517-aec7-e7f26ea41284@googlegroups.com>
In reply to#3328
> Here is a compact 6502 routine which uses 7 bytes of stack and can be used to run code in aux mem or return to code in main:
> 
> 01F9:99 04 C0  STA $C004,Y
> 01FC:99 02 C0  STA $C002,Y
> 01FF:60        RTS
> 
> To call an aux function:
> 
> JSR to a helper routine in main memory which:
> pushes the aux address-1 onto the stack
> LDY #1
> JMP $1F9
> 
> The aux function returns via:
> 
> LDY #0
> JMP $1F9

And this technique is exactly what ProRWTS uses, too, except running from banked RAM instead of stack (jsr setaux with X=0 or 1).

[toc] | [prev] | [next] | [standalone]


#3322

Fromqkumba <peter.ferrie@gmail.com>
Date2017-03-04 22:11 -0800
Message-ID<8687e7b8-708c-4568-bd27-4f5f85c594b4@googlegroups.com>
In reply to#3318
> I try to avoid using the stack if possible
> 
> maybe this
> 
>  asl
>  tax
>  sta $c005
>  sta $c003
>  stx table+1
>  sta $c004'
>  sta $c002
>  rts
> table equ *
>  jmp ($800)

It's missing the "jsr table" to perform the actual dispatch, and which must also use the stack.  In that respect, it's no different from what I had.

[toc] | [prev] | [next] | [standalone]


#3377

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2017-03-15 19:06 -0700
Message-ID<3cf70408-6000-456e-8c72-c2d57c8e90f0@googlegroups.com>
In reply to#3311
> There is one Applesoft routine that uses $100.10F that could be called when control is in Main memory. 

Are you referring to FOUT @ $ED34 ?

http://jamtronix.com/files/applesoft.html#fout


[toc] | [prev] | [next] | [standalone]


#3325

FromBenoit0123 <bgilon@free.fr>
Date2017-03-06 00:20 +0000
Message-ID<benoit0123-1488759788@macgui.com>
In reply to#3305
I do not know whether I am off topic or not. Forgive me if this is the case,
but to transfer control from AUX memory to MAIN memory, I am using the BRK
opcode (with accepts one operand). 
Therefore, If I manage an address table within main memory, I can call any
subroutine within main bank from any aux bank (I say any because it applies
to any RAMWorks protocol additional aux memory bank). The only pre
requirement is that the vector exists in AUX bank LC and the C3 page be
dedicated to internal ROM (not to the slot 3).
Also the fact that the whole  BRK handling is performed with interrupts
disabled can prove useful sometimes.
If some routine have been defined within an aux mem bank, then it can be
called using the XFER call or by any other mean discussed in this thread.
Disadvantage: Aux to Aux control will imply increasing the number of data
buffer copy operations with the main memory which can be costly in terms of
performance particularly if this is the same aux bank.

Just my two cents,
BenoƮt


-- 
Growing old is mandatory..
growing up is optional..
But the other way round is as true.

[toc] | [prev] | [next] | [standalone]


#3327

From6502workshop@gmail.com
Date2017-03-05 20:13 -0800
Message-ID<565b4ab5-bda5-4cbf-835b-a2d37952e949@googlegroups.com>
In reply to#3302
Many thanks to everyone for providing the code for an alternative approach to XFER. 


Mark

[toc] | [prev] | [next] | [standalone]


#3349

Fromlaseractiveguy@gmail.com
Date2017-03-08 16:33 -0800
Message-ID<c527307f-7e67-4996-89c5-244b4f5768af@googlegroups.com>
In reply to#3302
Hey M. Overholster...!   I'm commenting because you mentioned SFX multi-tasking audio that uses AUX MEM.   Basically, how it works is before any major code, the program/game ect is loaded the large music file is BLOADED into memory and then uses AUX=MOVE to move the 1bit sound files into aux ram, putting them out of the way giving room for the program in the lower64kb.   During the music running routines... it automatically calculates apx how much code it needs to run before returning the routine back to the code (almost by magic)... but it transfers 256 bytes to a 'SFX Stack/area in the lower 64kb, which the music runs from there.   So every 4 to 8 frames (depending on need/speed requirements) it uses AUX-MOVE to move the next 256 bytes of audio...but it only uses 32/64 or some other number of bytes at a time... when it reaches the end it again moves the next sector into the 'temporary area' in the lower 64k.   Of course, this is supplemented by sound effects which essentially do the same thing except save the pointers (if you call them that) of the currently playing audio... does the sound effects and then replaces the pointers and continues where it left off.   Unfortunately , it only uses AUX-MOVE and not the AUX-XFER.... 

[toc] | [prev] | [next] | [standalone]


#3350

Fromlaseractiveguy@gmail.com
Date2017-03-08 17:04 -0800
Message-ID<41fcd358-387b-4644-b250-9991b660475d@googlegroups.com>
In reply to#3302
I'll post how I do Aux-Move... I love boiling down all the extraneous data into the most concise routines... a note, I only transfer whole 256blocks of data for ease of use... Applesoft basic...
-------------------------------
FROM NORMAL MEMORY TO AUX MEMORY (OR REVERSE)
*REQUIRES [LORES.LIB or Equiv]
---
	2 A = 8:B = A + 10:C = 4: GOSUB 9998
	3 REM 'A - START PG
	4 REM 'B - HOW MANY PGS TO MOVE
	5 REM 'C - PG TO MOVE TO
-----
 9990  POKE 60,0: POKE 62,255: POKE 66,0: 
 9991  POKE 61,A: POKE 63,B: POKE 67,C: RETURN 

 9998  GOSUB 9990: CALL 36190: RETURN : REM              'FROM AUX
 9999  GOSUB 9990: CALL 36195: RETURN : REM              'TO AU
----------------------------
36190-   18          CLC   
36191-   20 11 C3    JSR   49937
36194-   60          RTS   
36195-   38          SEC   
36196-   20 11 C3    JSR   49937
36199-   60          RTS   


In the example above... Setup code in Line 2
A = (Start Block), B =(A + HOW MANY BLOCKS TO MOVE) C = MOVE TO START
Then  GOSUB 9998 = (AUX TO MAIN) 
or    GOSUB 9999 = (MAIN to AUX)

*An amusing glitch I was dealing with for a long time, I use to have POKE 62,0 which causes a graphical glitch on my rotating coin in Dogfighters of Mars 2... it took forever to figure out that it was moving 1 extra byte then needed...!

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.sys.apple2.programmer


csiph-web