Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Nicron ! (Registered 2024-05-21) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > $01 register
2010-09-10 01:25
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....
 
2010-09-11 17:55
Graham
Account closed

Registered: Dec 2002
Posts: 990
Quoting TWW
This 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.
2010-09-11 21:57
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. :)
2010-09-12 01:38
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)
2010-09-12 02:14
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!!!

2010-09-12 02:38
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 :)
2010-09-12 07:35
MagerValp

Registered: Dec 2001
Posts: 1060
Quoting enthusi
also 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."
2010-09-12 10:48
Stryyker

Registered: Dec 2001
Posts: 465
Can you tell us more about the decrunch routine? Perhaps that is cuasing all the issues.
2010-09-12 16:51
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!)
2010-09-12 21:34
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.
2010-09-18 13:43
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Fred/Channel 4
Gordian
Will/Chimera
Menace/Spaceballs
Steveboy
pcollins/Quantum
tlr
Guests online: 65
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 No Bounds  (9.6)
7 Comaland 100%  (9.6)
8 Uncensored  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Layers  (9.6)
2 It's More Fun to Com..  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Covert Bitops  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Crest  (9.3)
5 Censor Design  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Stinsen  (9.7)
3 Jeroen Tel  (9.6)
4 Linus  (9.6)
5 MacMagix  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.076 sec.