Login
Forum Help



Post Your Message
="hidden" name="cat" value="Programming">
Username: (Login)

Topic:
Message:
 


Previous Messages
Posted By

Harry Potter
on 2024-05-08
07:32:33
 Re: cc65 : questions, answers and experiences

The reason the first two bytes are dropped out is because the kernal LOAD routine treats the file as a program. You need to use cbm_open()/cbm_read()/cbm_close().

Posted By

bszggg
on 2024-05-07
09:23:46
 Re: cc65 : questions, answers and experiences

-How can I delete my post? (I have just edit button)

(Finally I found the solution
I have to set it as a star
*gg->yposition= 0x08;
and get is from with star
POKE(3072, *gg->yposition);

-------------------------------
UPDATE:

Do somebody use a load in cc65?

This code works:

cbm_k_setnam("loader");
cbm_k_setlfs(0,8,0);
cbm_k_load(0, 0x0c00); // 0 is LOAD, 1 is VERIFY, 2 and 3 are VERA.

But just PRG.

How can I load SEQ?



-------------------------------
UPDATE:
This works, but the first 2 bytes has been dropped out:

cbm_k_setnam("sequential,s,r");
cbm_k_setlfs(0,8,0);
cbm_k_load(0, 0x0c00); // 0 is LOAD, 1 is VERIFY, 2 and 3 are VERA.



-------------------------------
UPDATE:
A megoldás: / The solution:
nem hívom meg utasításként, hanem asm utasításban gépikódként, és előtte be jkell lapozni a ROM-ot, majd visszalapozni a RAM-ot.
Érdekesség még, hogy a cbm_k_chkin(2); -t ami kiválasztja a megnyitott csatornát, azt minden bájt olvasása előtt meg kell hívni.
/ Call kernal routin with assembly, and need to do the paging manually, and it has to be call the cbm_k_chkin(openedchannel) before every bytes read


Tehát A megoldás ez lett:

unsigned char getByte()
{
unsigned char b;
__asm__ ("STA $FF3E");
__asm__ ("JSR $ffcf");
__asm__("STA $0c00");
__asm__ ("STA $FF3F");
b = PEEK(3072);
printf("\nb: %x",b);
return b;
}

...main:
cbm_k_setlfs(2, 8, 2);
cbm_k_setnam("sequential,s,r");
cbm_k_open();

for (i = 0; i < 10; ++i) {
cbm_k_chkin(2);
b=getByte();
printf("\n-x- %x",b);
}
cbm_k_close(2);


Posted By

Haegar
on 2024-04-22
12:13:21
 Re: cc65 : questions, answers and experiences

I asked a similar question a while ago:

change graphics memory

So the thanks go more to Csabo

Posted By

bszggg
on 2024-04-22
11:52:22
 Re: cc65 : questions, answers and experiences

@Haegar
Yes..
It works if is use SEI..
the interrupt switch back the original (color and luma) address.

a good solution to use the $07fb address

POKE(131,32); // 32 1-es mode, 96 2mod , 160 3mode, 224 4mode ||| $83 $60
POKE(0xff12,0xd8); // Graphical bitmap push to $6000
POKE(0x07FB,0x5f); // color and luma push below $6000 ($5800)

Thank you for your answer.. I'll use it for multicolor change happy HUG!

Posted By

Haegar
on 2024-04-22
09:01:11
 Re: cc65 : questions, answers and experiences

Hello,

I hope I understood your question correctly:

colormap = $3800
bitmap = $4000

* = $xxxx

lda #$3b ; Hires on
sta $ff06
lda $FF07 ; PAL/NTSC friendly
lda #>bitrmap ; bitmap at $4000
ora #$18 ; $18 = multicolor, $08 = hires
sta $FF07

lda $FF12
and #$03 ; keep lowest 2 bits (sound)
ora #$10 ; $08 = $2000, $10 = $4000, etc., and RAM on
sta $FF12

lda #>colormap ; color map at $3800
sta $FF14

You can place the colormap in memory every $800 ($800, $1000, $1800, ...), the bitmap every $2000 ($2000, $4000, $6000,...).

Posted By

bszggg
on 2024-04-21
18:38:59
 Re: cc65 : questions, answers and experiences

Hi!
has anyone of us made such a program with this that the graphic storage space did not cause an obstacle.
Ex: Did it start at $4,000?
or did you somehow translate something that copied itself back, or did you solve this?

As my first idea, I try to move the graphical space move to $6000, and it works ($ff12), but the color left on wrong place.. than I move it with $ff14, but the interrupt always set back to $1800

do you have any idea to solve this.
(my code longer than $1000-$1800 and I would like to use the graphic mode too)

THX!

Posted By

bszggg
on 2024-04-21
18:34:19
 cc65 : questions, answers and experiences

This topic is about using cc65 for the plus4 programming.


Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon