Custom Characters in cassette buffer

Basic and Machine Language

Moderator: Moderators

Mobsie
Vic 20 Drifter
Posts: 32
Joined: Mon Apr 26, 2004 7:51 am
Location: Germany

Custom Characters in cassette buffer

Post by Mobsie »

Hi,

The cassette buffer can be used to create 25 custom characters.
Store it starting at 824.

To Acces poke 36869,248

Use character values from 103 to 127 to poke these characters to screen.

If you use the location 664-767 to (Poke this with values 83-95), for 12 custom chars than you have 37 custom characters and still have 3.5k of program space.

It's like an 512 byte ram expansion. I tried this stuff, it works fine.

Cheers
Mike
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Good suggestions. Worth pointing out is that address 664-672 are used with RS232 communication, so if you have any such devices connected and in use, you better stay away from putting UDGs there. Otherwise it should be fairly clean ground. I wonder if not Microdigital's pinball game (known as Pinball Wizard or Flipper) uses some or both of these areas.
Anders Carlsson

Image Image Image Image Image
Mobsie
Vic 20 Drifter
Posts: 32
Joined: Mon Apr 26, 2004 7:51 am
Location: Germany

Post by Mobsie »

Hi,

yes thats right. But when i use or play games i don't use thinks who need RS232 stuff. I only play.

cheers
Mike
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Cool! Thanks! And this space should work on both unexpanded and expanded vics too!!! (but with a different poke) and that is really great I think!!!

The poke for both unexpanded and expanded vics would probably be:
poke 36869,(peek(36869)and240)+8

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Maybe some networking/modem game with lots of graphics. :lol:
Anders Carlsson

Image Image Image Image Image
Mobsie
Vic 20 Drifter
Posts: 32
Joined: Mon Apr 26, 2004 7:51 am
Location: Germany

Post by Mobsie »

Hi,

yes me make many new games together. Everybody know some tricks/tips, and all together ???

In the near future all XBox user wan't buy an VIC-20 to play the new games. :D :D

I like the little but wery good VIC-20 Scene, and the people here in this forum.

Cheers
Mike
User avatar
Ghislain
Realms of Quest
Posts: 1279
Joined: Sun Aug 08, 2004 12:54 am

Post by Ghislain »

Thanks for the tip! I just tried POKE 36869,248 and I saw that the character 32 (space) wasn't affected--that's great for when you need to clear the screen. This would probably work best under a multi-loading game situation where you can use 37 characters for a VIC with a disk drive and 12 characters for a VIC with a tape drive. The only drawback for 248 is that you can't print characters in reverse to show text on the screen as you can in 255 mode. So one would have to switch between 248 and 240 mode to show text.
"A slave is one who waits for someone to come and free him." -- Ezra Pound
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

I just used your tip to add some graphics to this program:
http://sleepingelephant.com/ipw-web/bul ... =1865#1865

Cool! My first program ever with graphics that works on both expanded and unexpanded vic!

Btw, Char 32 IS affected! The reason you didn't see it must be that chars on the screen by default is white (the same as the background color).

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Guest

Post by Guest »

Boray wrote:
Btw, Char 32 IS affected! The reason you didn't see it must be that chars on the screen by default is white (the same as the background color).

/Anders
My mistake! I went into a VIC emulator and quickly tried POKE 36869,248 without changing the screen color.
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

I usually save my games to disk (and tape) by altering the end of memory pointer... no data statements to read, they are ready to go when I RUN it.

Would this trick prevent me from saving user graphics without data statements? I assume this would greatly affect TAPE opperation. THe graphics would be overwritten when the tape is in use (?) DId that make sense? or am I just confused?
High Scores, Links, and Jeff's Basic Games page.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Jeff, If you would like to use the tape buffer without data statements, then you would end up with a 2-part game. One part with the game and one with the graphics. You save the graphics with for example a machine language monitor (or do some extensive pokeing maybe ;) )... and then from the game, do this:

1 IF A=0THENA=1:LOAD"GFX PART",8,1

And yes, the graphics would be overwritten when using the tape...

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

More good news!!! You can compile programs with Austro-compiler
and still use graphics using this memory space!!! I have been looking
for a way to do this for some time, and thanks to this tip,
I now have it!

Austro-compiler can only compile programs for expanded vic20,
and as you need to move the basic memory to be able to use
graphics in the "normal" memory area, then the compiled program
would end up on the incorrect address and not be able to execute.
Now, with the graphics in the tape buffer, you don't need to
move the basic memory, and the compiled program runs just fine!
As a test, I compiled my "snow" program, and here is the result:

(for expanded vic only)
http://home.worldonline.se/boray/datorm ... inter2.zip

More about Austro-compiler and other compilers:
http://sleepingelephant.com/ipw-web/bul ... .php?t=142

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

I wonder if it is possible to customize the content of the tape buffer, so your tape program would load (a few) UDGs into the buffer at the same time you load the main program. It would make it even more difficult to duplicate though. Off-hand, I'm not sure exactly how much of the space in the tape buffer is used, but maybe you would have room for a handful of characters.

Another idea is to crunch your finished program. Add a small bit of machine code at the end of your Basic program, which will relocate graphics to the desired areas and end with a few JSR/JMP to fetch next Basic statement. By using e.g. Pucrunch with the starting address of the machine code segment (that will be overwritten once the Basic program is running), you can do a lot of single-file magic. :lol:
Anders Carlsson

Image Image Image Image Image
Rob Murphy
Vic 20 Drifter
Posts: 35
Joined: Fri Dec 17, 2004 8:14 pm

Cassette Graphics

Post by Rob Murphy »

I was just wondering where you came up with this Idea. I seem to have run into this Idea before. I think it was on this site:

http://www.kdef.com/geek/vic/

I just thought credit should be given where credit is due. I've written very few games in my time. I know very little ML programming (but am working twards getting better). When I posted this idea on that site I had never before seen the idea of useing that little piece of memory for custom chars, not in books, magazines, or the internet.

That being said,

I'll get back to programming.

Rob Murphy
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Btw... It works on the c64 too...

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Post Reply