Hello Hit9918.
I've been playing around with the addresses you mentioned, &H0004, &HF920 and &HF91F.
So is this the procedure to follow then:
1. POKE my own FONT into an address (between 0 and 255),
2. POKE &HF920,(between 0 and 255)
3. POKE &HF91G,3
and that should result in my font being available in ALL screen modes...?
I must say that whole slot-thing has got me confused. Basically anything I do in basic is confined to slot 3, right?
Then why if I PEEK do I get stuff from SLOT0 (as I mentioned before I did PEEK(7111) and thought I was looking at RAM...
Greetings, Ron.
Not confined to slot 3.. it's different on every MSX. That "procedure" you listed is not going to work at all.
I made it easy for you, only the RAM address to worry about. Follow what I wrote and you'll be fine.
1. put font somewhere in RAM
2. put the address in AD
3. put the line from my previous post after it
4. profit!
(there is no "???" step)
Hello Specialist,
It's like you said earlier, your code stars to resemble assembler, and that's not exactly a strong-point of mine. And I have this weird hangup of wanting to understand the code that I put into my programs. So let's see if I do:
SL = (INP(&HA8) \ 2 ^ ((AD \ 8192) AND 6)) AND 3
This line calculates the SLOT-number from my chosen address , making the code more universal across MSXes.
POKE &HF91F, PEEK(&HFCC1 + SL) + ((PEEK(&HFCC5 + SL) \ 2 ^ ((AD \ 8192) AND 6)) AND 3 ) * 4 +
Here you POKE the slot number into address &HF91F, letting BASIC know which SLOT I'm using.
POKE &HF920,AD AND 255OKE &HF921,AD \ 256
And lastly the address 's low and high byte are set into address &HF920 and following, letting BASIC know which ADRESS I'm using.
Hope that this is correct, otherwise I'm still lost.
Also: I'm really grateful for your help and sorry that it takes such a long time for me to understand all this
.
Greetings, Ron.
Yes, you got it right... Just remember that when you are using BASIC first 32KB (#0000-7FFF) is ROM. (Read Only Memory) at address #8000 there is your BASIC program and variables, then there is some free space that you can use and after that comes stack, possibly some disk stuff, BASIC/BIOS internal variables and then hooks. Practically I would say that something like #A000-#D800 is pretty relatively safe space to put your font. I tend to use #C000 for my random data I need in my programs.
Hi guys!
Yup, finally got it working the way I wanted it to, AND I understand the code!
A big "Thank You!" to everybody who helped.
Greetings,
Ron.
10 for a=&h9000 to &hEFFF step 2 20 poke a+0,&h10101010 21 poke a+1,&h01010101 30 next 100 screen0 111 AD=&hA000 115 SL = INP(&HA8) \ (2 ^ (AD \ 8192) AND 2) 116 POKE &HF91F, PEEK(&HFCC1 + SL) + PEEK(&HFCC5 + SL) * 4 + SL 117 POKE &HF920,AD AND 255 118 POKE &HF921,AD \ 256 120 screen1 run
it shows "Division by zero in 115"
Probably some parentheses are missing:
115 SL = INP(&HA8) \ (2 ^ ((AD \ 8192) AND 2))
thanks, @Grauw - now it’s "Illegal function call in 116"...
this one worked fine:
100 a=peek(5)*256+peek(4) 101 for e=0 to 2047 102 u=peek(a+e) 103 poke &hd000+e,u or u/2 104 next 200 poke &hf91f,(inp(&ha8)and48)/16 201 poke &hf920,0 202 poke &hf921,&hd0 203 screen1 run