Help on converting unexpanded BASIC program to 8kb expanded

Basic and Machine Language

Moderator: Moderators

Post Reply
jalavera
Vic 20 Drifter
Posts: 23
Joined: Wed Aug 05, 2009 4:49 am

Help on converting unexpanded BASIC program to 8kb expanded

Post by jalavera »

Hi to all!!

I attach a game "duck hunter" from an old spanish publication. The original version has some minor errors but easily fixed by my own because it is written in BASIC.

This game, in short, uses POKEs to draw in graphical mode into screen in an unexpanded VIC. It's written to be controlled with a Joystick (more POKEs and PEEKs).

I want to compile using Austro Compiler, which needs 8Kb expansion to run. When I compile, there are no errors , but POKE/PEEK's adresses are not updates to new 8 kb expansion adresses, so compiled version doesn't work.

My idea is to "remap" this POKE/PEEK (and others stuff if needed) in BASIC program to compile with Austro Compiler. I have not knowledge enough to do it on my own. So I need help....

Thanks

edit/ now the file is attached. Sorry
Attachments
PATOS.zip
Prg
(1.01 KiB) Downloaded 76 times
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Help on converting unexpanded BASIC program to 8kb expa

Post by Mike »

Cute little game! :)

Even if you change all POKE addresses concerning screen memory access, the user defined characters would still need to be handled.

The user defined characters - as everything that the video chip is supposed to access - can only be located in the RAM internal to the VIC-20. Even if you successfully relocate all screen POKEs, the compiled executable is so big, that it will likely deprive the UDGs of any remaining space of the internal RAM.

One Denial fellow once got Austro-Comp to work with UDGs by placing them into the ranges 680..767 (corresponding to the screen codes 85..95) and 824..1024 (tape buffer, corresponding to the screen codes 103..127). That character set is then activated with POKE36869,200 with the screen base at $1000. But then you can only use *those* characters 85..95 and 103..127 - the rest is committed to BASIC and KERNAL -, and the character ROM is not accessible with the reverse character trick as it is with POKE36869,255.

Why would you want to compile this game anyway? It would likely play too fast when compiled.
jalavera
Vic 20 Drifter
Posts: 23
Joined: Wed Aug 05, 2009 4:49 am

Re: Help on converting unexpanded BASIC program to 8kb expa

Post by jalavera »

Thanks Mike,

I can't understand 100% what you said, but the fact is that the short answer is 'no, I can't readress all POKEs from unexpanded to expanded version, basically because of user defined characters reallocation'.
It's a pitty because I want to implement some difficulties to game in the future, so more RAM should be necessary, so at least 8 Kb block is needed. :oops:

I'd want to compile in order to get some professional looking, avoiding gamer to STOP program and LIST, updating the code concerning speed in the game as a result of a speed increase due to compilation. I think it is not possible to avoid BREAK in a program written in BASIC (correct me if it is not true).

My next question is if it is possible to "re-cook" the original basic code to a cross link compiler such as Quetzcoatl or cc65 using only 'unexpanded VIC memory' and avoiding game break on run/stop key pressed.
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Help on converting unexpanded BASIC program to 8kb expa

Post by Mike »

jalavera wrote:I can't understand 100% what you said, but the fact is that the short answer is 'no, I can't readress all POKEs from unexpanded to expanded version, basically because of user defined characters reallocation'.
Not quite so. You *can* do user defined characters with +8K RAM expansion or more.

Your conflicting requirements were doing UDGs *and* using Austro-Comp.
I think it is not possible to avoid BREAK in a program written in BASIC (correct me if it is not true).
Of course it's possible to disable the STOP key for a BASIC program. That's done with just a single POKE. Likewise, the key combo STOP/RESTORE and the LIST command can be disabled.

That still won't stop people from taking a peep into your program.
FD22
Vic 20 Hobbyist
Posts: 148
Joined: Mon Feb 15, 2010 12:31 pm

Re: Help on converting unexpanded BASIC program to 8kb expa

Post by FD22 »

And in case you're wondering what that mysterious alluded-to-but-not-elucidated POKE is, it is POKE 808,100. This disables RUN/STOP, RESTORE, and LIST.
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Help on converting unexpanded BASIC program to 8kb expa

Post by Mike »

FD22 wrote:[...]that mysterious alluded-to-but-not-elucidated[...]
Listen, I'm well aware you don't like me, ever since this. You're repeating yourself.
Post Reply