| |
Kickback
Registered: Apr 2004 Posts: 97 |
$01 register
I know this was asked most-likely 1000 times already but my mind isn't as it use to be because of age and all LOL!!!
If I swap out all of the rom (store $34 into $01) do I need to have some sort of interrupt enabled? I seem to remember if you have the ROM off to long the system will crash? Is this the case or is it just plain ol bad programming LOL!!!
So basically I have my exomizer decrunch and I do the following....
lda #$34
sta $01
jsr decrunch
lda #$37
sta $01
Which I know the decrunch can take some time and not sure is this is why the system is getting hosed out!
|
|
... 24 posts hidden. Click here to view all posts.... |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Quoting TWWThis method ofcourse mean you allways know the contents of $01 (why shouldn't you?).
If you depack stuff below $D000 and then use the stuff with IO mapped in, $01 changes outside IRQs.
|
| |
Skate
Registered: Jul 2003 Posts: 491 |
if you need to switch $01 in your main effect loop, then a few cycles are of course important. but otherwise, if you need to change it once (probably twice) per frame, store it to 1541 and read it back if you want, it doesn't matter that much. :) |
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
You dont need any switch :D just poke 1,$35 and all is ready :D put $100 bytes fastloader in there, and we are rolling!!! (thank you Krill) |
| |
Kickback
Registered: Apr 2004 Posts: 97 |
Ok ok ok.... Here is what I want to do, cause we are getting off track here... I understand swapping out memory banks and as far as I know swapping out $d000 area is the same as the other areas you swap out? UNLESS your using those registers in that area? Correct?
Which I'm not, I am just decrunching into that area after I set $01. Now my IRQ on the other hand is, but it saves $01 and then swaps back in that area so this SHOULD work fine? Correct?
The reason I want to use this area is then I will have ALL of the area below it to use for whatever. IMHO it makes a lot of sense because this area is being "wasted" so to say? Why not use it for decrunching?
So with all that said, am I missing anything? Which I believe I am because if I do the following:
sei
lda #$34
sta $01
ldx
ldy
jsr decrunch
lda #$37
sta $01
cli
Doesn't work, I have no IRQ's enabled or anything just an outside small program for test. What am I missing here? Or maybe it was already explained above and my feeble mind can't grasp it? If that's the case could you please say it a bit sloooower LOL!!!
|
| |
Skate
Registered: Jul 2003 Posts: 491 |
@Kickback: give $30 a try instead of $34 for the first $01 value.
sei
lda #$30
sta $01
ldx
ldy
jsr decrunch
lda #$37
sta $01
cli
if it works, i'll explain the reason :) |
| |
MagerValp
Registered: Dec 2001 Posts: 1060 |
Quoting enthusialso some folks start viewing demos by hitting RESTORE to hunt for 'bugs'... :)
In the immortal words of Steve Jobs: "Just avoid holding it in this way."
|
| |
Stryyker
Registered: Dec 2001 Posts: 465 |
Can you tell us more about the decrunch routine? Perhaps that is cuasing all the issues. |
| |
Kickback
Registered: Apr 2004 Posts: 97 |
Quote: @Kickback: give $30 a try instead of $34 for the first $01 value.
sei
lda #$30
sta $01
ldx
ldy
jsr decrunch
lda #$37
sta $01
cli
if it works, i'll explain the reason :)
I tried the #$30 and it worked and then tried #$34 and it worked. I also found so stupid shit in my decruncher which was changing $01 also LOL! UGH!!
@Stryyker:
It's a typical Exomizer decruncher nothing special?
Now hopefully this works with the IRQ's turned on and I will be all set!
(keeping fingers crossed!) |
| |
Skate
Registered: Jul 2003 Posts: 491 |
@Kickback: yes, crunchers usually ask for $01 value and sets it at the initialization level. you seem to have missed that part. |
| |
MC Account closed
Registered: Jul 2009 Posts: 71 |
To clarify the #$30 / #$34 thing read the CHAREN bit in this:
6510 input/output port ($0001)
NAME BIT DIRECTION DESCRIPTION
LORAM 0 OUTPUT Control for RAM/ROM at
$A000-$BFFF (BASIC)
HIRAM 1 OUTPUT Control for RAM/ROM at
$E000-$FFFF(KERNAl)
CHAREN 2 OUTPUT Control for I/O/ROM at
$D000-$DFFF
3 OUTPUT Cassette write line
4 INPUT Cassette switch sense
5 OUTPUT Cassette motor control
LORAM (bit 0) can generally be thought of as a control line which banks the 8K byte BASIC ROM in and out of-the microprocessor address space. Normally, this line is HIGH for BASIC operation. If this line is programmed LOW, the BASIC ROM will disappear from the memory map and be replaced by 8K bytes of RAM from $A000-$BFFF.
HIRAM (bit 1) can generally be thought of as a control line which banks the 8K byte KERNALROM in and out of the microprocessor address space. Normally, this line is HIGH for BASIC operation. If this line
is programmed LOW, the KERNALROM will disappear from the memory map and be replaced by 8K bytes of RAM from $E000-$FFFF.
CHAREN (bit 2) is used only to bank the 4K byte character generator ROM in or out of the microprocessor address space. From the processor point of view, the character ROM occupies the same address space as the I/O devices ($D000-$DFFF).When the CHAREN line is set to 1 (as is normal), the I/O devices appear in the microprocessor address space, and the character ROM is not accessable. When the CHAREN bit is cleared to 0, the character ROM appears in the processor address space, and the I/O devices are not accessable. (The microprocessor only needs to access the character ROM when downloading the character set from ROM to RAM. Special care is needed for this... CHAREN can be overridden by other control lines in certain memory configurations. CHAREN will have no effect on any memory configuration without I/O devices. RAM will appear from $D000-$DFFF instead.
Puzzled by the CHAREN stuff which was copied directly from the C64's programmers manual? Short version: Setting the bit enables I/O devices, clearing the bit disables them thus allows the 4K of RAM space from $D000-$DFFF to be used instead.
Ofcourse, you don't want any possible interrupts left running in the ROM areas when switching those ROMS off.
#$30 is therefor probably your best bet when running a decruncher/decompressor type of thing, just switch all the ROM and I/O off to have as much as possible memory.
Just my 2 bits.
|
Previous - 1 | 2 | 3 | 4 - Next |