Author Topic: C128 memory extravagenza.  (Read 933 times)

0 Members and 1 Guest are viewing this topic.

Offline Stephane Richard

  • C64 user
  • *****
  • Posts: 278
  • Location: Upstate NY
  • Activity:
    0%
  • Reputation: 1
  • With us since: 29/09/2006
    YearsYearsYearsYearsYearsYearsYears
    • View Profile
    • http://www.symbioticsoftware.net
C128 memory extravagenza.
« on: March 29, 2011, 07:28 AM »
Hi guys, I have 2 questions I'm still playing with WinVice but these are aimed at C128 owners perhaps, maybe not. :)

1. In Winvice there's an option to enable bank 2 and bank 3 for the C128.  What is that all about?  and if that existed, did it raise the c128 to 256kb?  Or are these somekind of different RAM/ROM configuration?  where can I read the details of this?

2. This question is about the REU and C128 basic 7.0's swap, fetch and stash statements.  what exactly can be transwered to and from the REU with these commands? and does anyone have a quick and handy example on how to use them intelligently (the statements that is :) ).   

finally a stupid question because I know I could before lol.  WinVice use to have an option for using the REU.  In winvice 2.3  I can't seem to find where they put it.  Anyone know?

Thanks all I haven't been here often, but I have been busy playing in WinVice.  my birthday is next month for anyone wanting to send me a real C128, 1571 and a good 80 column monitor  ;D LOL

Take care guys :)
When God created light, so too was born, the first Shadow!

MystikShadows

Offline Hydrophilic

  • 128D user
  • *******
  • Posts: 1214
  • Age: 41
  • Location: Earth... still!
  • Activity:
    0%
  • Reputation: 232
  • Gender: Male
  • With us since: 25/01/2007
    YearsYearsYearsYearsYearsYears
    • View Profile
    • H2Obsesson
Re: C128 memory extravagenza.
« Reply #1 on: March 29, 2011, 11:13 AM »
1.
I haven't examined the latest source code, but the last I looked, the MMU module was written much as the device was internally designed.  Which is to say it could support 4 banks of internal RAM.  Presumably this enables all 4 banks of internal RAM, not REU RAM.  Although the MMU was internally desgined to handle 4 RAM banks, there are no I/O pins available on the chip to handle extra RAM banks.  Hacks I've seen to enable extra internal RAM on real machine must use extra hardware (for example a second MMU or maybe something in the function ROM socket).  So what I'm saying is this feature sounds like a neat idea, but it is compatible with absolutely nothing.
 
Also, the previous MMU implementation of WinVICE had some bugs.  I haven't checked the 2.3 version yet to see if these bugs still exist.  Anyway, I wouldn't bother playing with 'wishful' features of the MMU when the existing ones are (still?) broken.
 
2.
Disclaimer I don't own an REU, so I'm not an expert here... but I have written some progs that work in VICE and reported to work by others with real hardware, so hopefully this helps...
 
STASH / FETCH / SWAP are real easy to use.  Just issue a BANK command to set the desired C128 internal RAM bank to use, then issue STASH / FETCH / SWAP whose parameters specify the REU bank, as well as the C128 and REU addresses and byte length.  The only 'gotcha' is there is a bug with BANK and REU commands in the original C128 ROMs; VICE has the new ROMs, so if all you use is VICE, then no problem.
 
The BASIC commands all take the same parameters:
 
FETCH #bytes, C128adrs, REUadrs, REUbank
STASH #bytes, C128adrs, REUadrs, REUbank
SWAP  #bytes, C128adrs, REUadrs, REUbank
 
FETCH is used to read REU data into the C128, STASH is to write REU data from the C128 and SWAP will exchange data between the two.
 
So for example, to save all BASIC variable to the REU can use:
 
BANK1:STASH 64256,1024,0,1
 
and to recall them later
 
BANK1:FETCH 64256,1024,0,1
 
In both examples, all data from $0400 (1024) to $FEFF is transfered, which amounts to 64256 bytes; this is in BANK 1 of C128... and it goes to / comes from the REU at the very start of 'bank' 1.  Of course where you put the data in the REU is up to you as the programmer.
 
Another example to save all BASIC program area:
 
BANK0:STASH 58112,7168,0,0
 
This saves all data from $1c00 (7168) to $FEFF (a total of 58112 bytes) into start of REU 'bank' 0.
 
Also important: if you are using FAST mode, the computer should be switched to SLOW mode for REU transfers.
 
3.
Look under 'Settings', 'Cartridge I/O Settings', 'REU Settings...'
 
I'm kupo for kupo nuts!

Offline Stephane Richard

  • C64 user
  • *****
  • Posts: 278
  • Location: Upstate NY
  • Activity:
    0%
  • Reputation: 1
  • With us since: 29/09/2006
    YearsYearsYearsYearsYearsYearsYears
    • View Profile
    • http://www.symbioticsoftware.net
Re: C128 memory extravagenza.
« Reply #2 on: March 29, 2011, 11:32 PM »
There are the answers I needed :).  thank you hydro. 

For the REU I didn't know if I had to use it like a ram drive, or something, so it's really purely RAM related. :)  i'll start playing with that. :) thanks again.
When God created light, so too was born, the first Shadow!

MystikShadows

 



Back to top