Change the 8256 ASCII character on the Joyce.

Started by funkheld, 08:00, 30 August 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

robcfg

It means it tried to read more data than it really is.




funkheld


funkheld


hello, I implemented something small from asm.


in asm it works as com.
in basic the "A" is not converted.


thank you.
greeting


asm:


  LD HL,#10E         
  LD DE,#E290       
  LD BC,#0864         
  LDIR                 
  JP #E290             


  LD HL,(#0001)         
  LD DE,#0057       
  ADD HL,DE                 
  LD (#E29E),HL       
  LD BC,#E2A2         
  CALL #0000           
  JP (HL)                 
  NOP                   
  LD DE,#BA08   ; A = 65*8     
  LD HL,#E2AE         
  LD BC,#0008       
  LDIR                 
  RET   


db 255,129,129,129,129,129,129,255



basic:


10 MEMORY &HEFFF
20 plane%=&HF000
30 READ j%
40 FOR i%=0 TO j%-1
50 READ d%
60 POKE plane%+i%,d%
70 NEXT
80 CALL plane%
85 PRINT "A"
90 WHILE INKEY$<>"":WEND:WHILE INKEY$<>" ":WEND
100 END
10000 DATA 52
10010 DATA 33 ,14 ,1 ,17 ,144 ,226 ,1 ,100 ,8 ,237
10020 DATA 176 ,195 ,144 ,226 ,42 ,1 ,0 ,17 ,87 ,0
10030 DATA 25 ,34 ,158 ,226 ,1 ,162 ,226 ,205 ,0 ,0
10040 DATA 233 ,0 ,17 ,8 ,186 ,33 ,174 ,226 ,1 ,8
10050 DATA 0 ,237 ,176 ,201 ,255 ,129 ,129 ,129 ,129 ,129
10060 DATA 129 ,255 

JohnElliott

#28
Because the machine code you're trying to run was assembled to load at 0100h, but you're loading it at 0F000h without changing any of the addresses.

You need to drop the first 14 bytes (which try to copy code from 010Eh to 0E290h) and then relocate the rest to be based at 0F000h not 0E290h.

JohnElliott

Quote from: funkheld on 09:40, 03 September 20
Hello thanks for the information.


there is another mistake.
what kind of message is that.
As robcfg explains, there were more READ operations than DATA items to be read. For example, this would give the same error:
10 READ a: READ b: READ c  ' Three READs
20 DATA 10,20              ' But only two DATA items


Since the program as I posted it does not give this error (I've just tested it) I suspect you must have introduced a typo somewhere along the line.

funkheld


funkheld

#31
Hi good afternoon.
who can convert this asm for me once so that it also runs under basic mallard-basic.

I want to take the asm to learn to convert ascii.

I have already done it myself after the advice above, probably wrong.


thank you.
greeting



LD HL,#10E           
LD DE,#E290         
LD BC,#0864           
LDIR                   
JP #E290   
           
LD HL,(#0001)         
LD DE,#0057         
ADD HL,DE                   
LD (#E29E),HL         
LD BC,#E2A2           
CALL #0000             
JP (HL)   
               
NOP                   
LD DE,#BA08   ; A = 65*8       
LD HL,#E2AE           
LD BC,#0008         
LDIR   
               
RET
 
db 255,129,129,129,129,129,129,255

GeoffB17

#32
Hello,

I'm not sure what you mean by ALSO run under Mallard BASIC, you will need different code for different methods.   The code you show here may still be appropriate for putting in a .COM file, but clearly is NOT OK for BASIC.

As John Elliot suggested a few messages above, you need to remove the first bit, which relates to moving the code from low RAM (just aboue &H0100) where the .COM file is to high memory where it can do the Bank swap.   This code should NOT be there as the BASIC loader will put it in the right space anyway.   Anywhere from &HC000.   Exactly where is up to you, and whatever else you might put up there.

The rest of the code may be OK, but you need to change the &HE2?? addresses to be correct for the actual location of the code and the data.   You should set your compiler with ORG of &HE2?? I assume?

Geoff

JonB


funkheld


Unfortunately, I cannot find a solution with the suggestions given.
do not get to the goal to change the ascii with little asm code for an inline.


thank you.
greeting

GeoffB17

If you could post the asm code, AND the BASIC code, then I can have a look.   But the asm code on it's own isn't a massive help, esp if it contains a number of possible errors without the BASIC calling code to clarify things.

May be something simple.

Oh, I'd be interested to know what you're actually trying to do - eventually.   I assume you have some purpose in mind, other than simply changing as 'A' keypress into something else, when there are MUCH easier ways of doing that.

Geoff

JohnElliott

If you want to redefine characters from Mallard BASIC then the program I already posted upthread will do that just fine.

GeoffB17

John,

Absolutely - but I'm not sure that THATS what he's actually wanting to do.

Geoff

funkheld


Hi good afternoon.


i want to change the letters while the basic program is running.
there should be a moving change of the letter during the game, even if it is slow.


greeting

GeoffB17

OK.  You could achieve that by saving the original char data, then gradually changing the char and reprinting it, and put the char back at the end.   Not too bad if it's 1 char only.   Or, you could leave the char matrix alone and work on the screen RAM directly, and gradually fade the image (even a complete block of the screen or all the screen) out and then back into another image.   There was a system mentioned here not long ago for displaying SPC images/pictures and creating a slideshow that did just that, with various options.   I've not delved into the code to see how it was done but the methods there might be useful to you?

Also mentioned here a while back was the package WALBASIC, this is a system originating in France and provides an extension to Mallard BASIC (a large machine code extension using a loader process as used in other progs we've used here) which provides various graphics functions that are then activated using calls within the normal BASIC prog.  This includes setting or unsetting specific 'points' i.e. dots on the screen, which could include drawing letters and in effect fading them into something else.   Again, this would be accessing the screen RAM directly - but I don't think there was anything built-in to do the fading, unlike the SPC process.

I have the code for the WALBASIC, just the .COM files for the SPC stuff as I had no reason to dive into that!

Geoff

funkheld

hello thanks for the info.


-------------------------------
OK.  You could achieve that by saving the original char data, then gradually changing the char and reprinting it, and put the char back at the end. 
-------------------------------


how can a solution look like in asm for inline


greeting




GeoffB17

So, I'm still guessing somewhat about things you're not saying.

I think you want to change numerous chara (how many at the same time ?) and you want to change them into something else (another letter ?), different letters ?  one word into a different word ?

You want to do this change gradually, while other things are happening on the screen, so you'll have two (or more ?) processes running at the same time, swapping between the two (repeatedly ?).

Will it always be swapping one letter into another, i.e. A -> B, or might it be sometimes be A -> K (for example).  Do you want one letter to fade right away, then the new letter to fade in (I think the latter would be simpler ?).

I'd guess that the other action taking place could also involve the screen.   So rather than swap to the screen banks for each action, it might save a lot of swapping if you swap to screen and so something re letter change, then do something re the other action, and then swap back.   Or are you not too worried about speed?

Just a start?

Geoff

funkheld


Hi, Thank You.


the speed does not matter.


it should be something like a letter scrolling, 8 bytes of a letter scrolling up or down. the scrolling should be visible.


greeting

JohnElliott

That's perfectly doable with the program I gave you earlier. Either define eight different patterns for "A", or redefine "A" with a different pattern each time you want to draw it. Here's an example of the first approach. Change line 20 to20 FOR c=160 TO 167:POKE &HC099,c
so that it only defines 8 characters. Then replace lines 70-210 with70 DATA &H18, &H3c, &H66, &H66, &H7e, &H66, &H66, &H00
80 DATA &H00, &H18, &H3c, &H66, &H66, &H7e, &H66, &H66
90 DATA &H66, &H00, &H18, &H3c, &H66, &H66, &H7e, &H66
100 DATA &H66, &H66, &H00, &H18, &H3c, &H66, &H66, &H7e
110 DATA &H7e, &H66, &H66, &H00, &H18, &H3c, &H66, &H66
120 DATA &H66, &H7e, &H66, &H66, &H00, &H18, &H3c, &H66
130 DATA &H66, &H66, &H7e, &H66, &H66, &H00, &H18, &H3c
140 DATA &H3c, &H66, &H66, &H7e, &H66, &H66, &H00, &H18
160 FOR c=160 TO 167: PRINT CHR$(c);CHR$(8);:NEXT:GOTO 160


The eight DATA lines define an "A", scrolled up by zero, one, two, ... seven pixels. These shapes are loaded into characters 160-167, and then line 160 draws them one after the other in the same place.

funkheld

hello, thanks for help.



works wonderfully.
[size=78%]thank you.[/size]

Powered by SMFPacks Menu Editor Mod