| |
H.O Account closed
Registered: Oct 2002 Posts: 70 |
cleaning up between demoparts
One of favorite projects (or maybe not) -- I am currently trying to integrate some code made by others (basically, I am planning to do a release of some unreleased demo parts)
Problem is, one of the demo parts seems to be assuming a helluva lot of the c64. If I link the parts together, and do a soft reset I can start the last part with no problems.
But, if I have run some other demo part first, this part will just freeze up.
But, since I dont want anyone to have to use soft reset inside a demo, I want to clean up so that the final part works fine. Currently I am using the following calls:
sei
jsr $ff5b ; Initialize screen editor
jsr $fda3 ; Initialise I/O
jsr $fd15 ; Restore Kernal Vectors
lda #$00
ldx #$00
cleanme
sta $d800,x
inx
cpx #$28
bne cleanme
cli
Anything else that I can do? I am trying to avoid my worst case scenarios (which are releasing each part as they are as standalone applications, or rewriting most of the code that I didnt do; none af them are very appealing to me)
|
|
... 16 posts hidden. Click here to view all posts.... |
| |
tasche Account closed
Registered: Apr 2004 Posts: 12 |
remember the Kernel-Bug in $fd15 !!!
;----------------------------------------------
FD15 A2 30 LDX #$30 ; low FD30
FD17 A0 FD LDY #$FD ; high FD30
FD19 18 CLC
FD1A 86 C3 STX $C3
FD1C 84 C4 STY $C4
FD1E A0 1F LDY #$1F
FD20 B9 14 03 LDA $0314,Y
FD23 B0 02 BCS $FD27
FD25 B1 C3 LDA ($C3),Y
FD27 91 C3 STA ($C3),Y ; this writes into RAM, which
; can kill placed Data !!!
FD29 99 14 03 STA $0314,Y
FD2C 88 DEY
FD2D 10 F1 BPL $FD20
FD2F 60 RTS
;---------------------------------------------- |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
when will all pc headed dude finally learn that:
kernel != kernal
anyways, the code clears the C bit, and I dont see instruction that changes C until the bcs takes place.
|
| |
tasche Account closed
Registered: Apr 2004 Posts: 12 |
@oswald:
till it could have been a spelling mistake??
i might be wrong, but kernal is the name of the c64 kernel, coz i learnt in former days, that in computer engineering, the kernel is the core of an operating system, or am i wrong?
btw: this routine is 100% writing into the ram under the rom. regardless if c is set or not. |
| |
Honesty
Registered: Jan 2003 Posts: 121 |
Hm i tried it to be honest...
I filled area from f000 to ffff with 0 and then with ff
and after switching of the rom there is only ff...
|
| |
tasche Account closed
Registered: Apr 2004 Posts: 12 |
@honesty: do you have a non-moded rom? means, the posted routine is the same, as in your rom? coz if so, u must have the io-vectors in your ram, located from $fd30 to $fd50. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
taschentechno:
the rom at e000-ffff is called KERNAL. The name "kernal" has nothing to do with "kernel" it just sounds similar. Kernal can be looked at as the WHOLE OS of the c64.(or show me the core of the OS where it is ?) Then we got the basic rom at a000-c000.
"btw: this routine is 100% writing into the ram under the rom. regardless if c is set or not."
thats sure, but if C is not set then then it wont alter the information stored in the ram (lda (c3),y sta (c3),y). if c is set it will. |
| |
tasche Account closed
Registered: Apr 2004 Posts: 12 |
@oswald:
hmm... ok, but it seems, that i differ with you by the meaning of core-routines (:
back to the real problem:
i thought of using the routine by its jump-vector, as Tch posted. so there wouldn't be any requierment in thinking, if the io-vectors are set or not.
this routine just reminds me, when i used it years ago, i had this ram-writing problem and nearly got a headache, till i found this lousy bug. ^^
|
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
If I have a really troubling piece of code I hand reset any needed vectors, fix the stack pointer, fix both CIAs and VIC II so the proper interrupts happen then test. |
| |
midiland Account closed
Registered: Nov 2004 Posts: 4 |
Just cheat....
Set the cartridge auto start at $8000 and then do a soft reset :D |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
@Oswald:
You're wrong, the LDA ($C3),Y STA ($C3),Y will read from ROM and write to RAM. |
Previous - 1 | 2 | 3 - Next |