Some things not working for me
I don't think there's anything yet. However, give me sometime to revisit the VZ graphics drivers and I'll see what can be done - I really should unify the block and hires graphics so that it's a run-time choice not a compile time choice.
The way I've handled colour for some other machines is to use the textcolor() and textbackground() functions to set the graphics colour - it's slightly under the hood but works well on those machines with graphics as part of the character set.
The way I've handled colour for some other machines is to use the textcolor() and textbackground() functions to set the graphics colour - it's slightly under the hood but works well on those machines with graphics as part of the character set.
There's also the non optimal (but handy)
Proportional font driver built for the x11 emulation.
It uses all the fonts the Sprite Editor is able to grab (NewsMaster, PrintMaster, GEOS..).
https://www.z88dk.org/forum/viewtopic.p ... 659#p14659
Proportional font driver built for the x11 emulation.
It uses all the fonts the Sprite Editor is able to grab (NewsMaster, PrintMaster, GEOS..).
https://www.z88dk.org/forum/viewtopic.p ... 659#p14659
Thank you for this routine - it's proving quite useful testing out targets.
I'm chasing down rabbit holes at the moment, so I'm not at the point where I can merge, however I've got the VZ code running in both screen modes including colour.
In addition to that it's running on quite a few other ports as I winkle out the bugs. So far: ZX, PC6001, RX78, PV1000, SMC777
When I'm happy I'll pass the code back to you: to get the cross platform support I've had to make a few (minor) tweaks, mostly in main.c
I'm chasing down rabbit holes at the moment, so I'm not at the point where I can merge, however I've got the VZ code running in both screen modes including colour.
In addition to that it's running on quite a few other ports as I winkle out the bugs. So far: ZX, PC6001, RX78, PV1000, SMC777
When I'm happy I'll pass the code back to you: to get the cross platform support I've had to make a few (minor) tweaks, mostly in main.c
Sweet. Very excited about that. Glad it works on other platforms. I'd like to do proportional fonts but it might be a lot of work for developers to add a parameter for each character manually.
I'd like to do coloured sprites but since z88dk doesn't support that and the VZ computers have this 4 pixels power byte Crap I might have to make it VZ only and stick with moving sprites by 4 pixels left and right when moving around the screen.
I'd like to do coloured sprites but since z88dk doesn't support that and the VZ computers have this 4 pixels power byte Crap I might have to make it VZ only and stick with moving sprites by 4 pixels left and right when moving around the screen.
As mentioned above I spent a bit of time on the VZ, the MC6847 is wired up in a really weird way on this machine.
I've just merged a bunch of changes that will affect your code:
- The generic console now supports mode 1, this means that ridiculously sized 8x8 fonts are now available on the VZ
- Graphical functions now work in mode 0 and mode 1. So you need to explicitly select the mode using console_ioctl() or vz_mode(). Using console_ioctl() the CSS can in theory be set so you end up with different colours.
- The mode 1 graphics functions now support colour: set using textcolor(). I'm not convinced the mappings are 100% correct to be honest.
- Putsprite now also respects the colour configured as above
There's some changes I made last week that your code needs adapting for:
- Using the correct struct accessor: all fontspec accesses need to be via "." not "->"
Regarding your own functions - please don't add them to the crt! Keep them as files in your project: zcc can handle c files and .asm files at the same time.
I've just merged a bunch of changes that will affect your code:
- The generic console now supports mode 1, this means that ridiculously sized 8x8 fonts are now available on the VZ
- Graphical functions now work in mode 0 and mode 1. So you need to explicitly select the mode using console_ioctl() or vz_mode(). Using console_ioctl() the CSS can in theory be set so you end up with different colours.
- The mode 1 graphics functions now support colour: set using textcolor(). I'm not convinced the mappings are 100% correct to be honest.
- Putsprite now also respects the colour configured as above
There's some changes I made last week that your code needs adapting for:
- Using the correct struct accessor: all fontspec accesses need to be via "." not "->"
Regarding your own functions - please don't add them to the crt! Keep them as files in your project: zcc can handle c files and .asm files at the same time.
switch doesn't seem to work with constants.
gives an error
So does:
Only thing that works:
Code: Select all
#define FX = 0
soundfx(FX);
Code: Select all
void soundfx(int sound)
{
switch(sound)
{
case FX:
So does:
Code: Select all
const int FX = 0;
switch (sound)
{
case FX:
Code: Select all
switch (sound)
{
case 0:
Trying to use delay(x):
Code: Select all
delay(5);
Error at file 'main.c' line 1621: symbol '_delay' not defined
Errors in source file D:\Dev\VZ\z88dk\lib\config\..\..\\lib\target\vz\classic\vz_crt0.asm:
Error at file 'main.c' line 1621: symbol '_delay' not defined
^ ---- (null)
Tried the bit_play demo tune in the wiki:
Code: Select all
bit_play("2A--A-B-CDEFGAB5C+");
Error at file 'bit_play.c' line 496: symbol 'dmul' not defined
Error at file 'bit_play.c' line 497: symbol 'ifix' not defined
Error at file 'bit_play.c' line 506: symbol 'dswap' not defined
Error at file 'bit_play.c' line 507: symbol 'ddiv' not defined
Error at file 'bit_play.c' line 511: symbol 'dsub' not defined
Error at file 'bit_play.c' line 512: symbol 'ifix' not defined
Error at file 'z80/sccz80/int2long_s_float.asm' line 19: symbol 'float' not defined
Error at file 'z80/sccz80/int2long_s_float.asm' line 22: symbol 'float' not defined
Error at file 'z80/sccz80/fa.asm' line 12: symbol 'init_floatpack' not defined
Errors in source file D:\Dev\VZ\z88dk\lib\config\..\..\\lib\target\vz\classic\vz_crt0.asm:
Error at file 'bit_play.c' line 496: symbol 'dmul' not defined
Error at file 'bit_play.c' line 497: symbol 'ifix' not defined
Error at file 'bit_play.c' line 506: symbol 'dswap' not defined
Error at file 'bit_play.c' line 507: symbol 'ddiv' not defined
Error at file 'bit_play.c' line 511: symbol 'dsub' not defined
Error at file 'bit_play.c' line 512: symbol 'ifix' not defined
Error at file 'z80/sccz80/int2long_s_float.asm' line 19: symbol 'float' not defined
Error at file 'z80/sccz80/int2long_s_float.asm' line 22: symbol 'float' not defined
Error at file 'z80/sccz80/fa.asm' line 12: symbol 'init_floatpack' not defined
The switch is an interesting one, however it looks like neither sdcc nor sccz80 accept a non-constant expression there, so basically you can't switch on variable - just use a #define or an enum instead, eg #define FX 0 - there's no need for the '=' which you've got in your snippet.
It looks like I removed delay() a while back and replaced it with the more meaningfully named msleep(int mills) - sorry about that, you should have had a compiler diagnostic about it though.
It looks like I removed delay() a while back and replaced it with the more meaningfully named msleep(int mills) - sorry about that, you should have had a compiler diagnostic about it though.
Do you need special calls or just an input from a port?
If it's the latter, try this other recent thread: https://www.z88dk.org/forum/viewtopic.php?id=11168
If it's the latter, try this other recent thread: https://www.z88dk.org/forum/viewtopic.php?id=11168
There's a page on calling conventions here: https://github.com/z88dk/z88dk/wiki/CallingConventions - the return value goes in hl for an 8/16 bit value.
So I'm guessing your function should look something like this:
So I'm guessing your function should look something like this:
Code: Select all
; uint8_t read_joystick()
read_joystick:
_read_joystick:
in a,($20)
; Shuffle bits around if necessary to match a convention
ld l,a
ld h,0
ret
Now I've looked at the spec, I'd probably do it something like this:
It's probably worth adding to the library to be honest - which emulator actually emulates the joystick?
Code: Select all
#define UP 1
#define DOWN 2
#define LEFT 4
#define RIGHT 8
#define FIRE 16
extern uint8_t vz_joystick(int stick_number) __z88dk_fastcall;
...
int j = vz_joystick(1);
if ( j & UP ) {
...
} else if ( j & DOWN ) {
...
}
...
SECTION code_clib
PUBLIC vz_joystick
PUBLIC _vz_joystick
; uint8_t vz_joystick(int number) __z88dk_fastcall;
vz_joystick:
_vz_joystick:
in a,($2e) ; Read joystick 1
dec l ; l = 1 is joystick 1, l = 2 is joystick 2
jr z,joystick_read
; Read joy2
in a,($2b)
joystick_read:
cpl
and @00011111
ld l,a
ld h,0
ret
I tested it on my Real VZ300. Up, Down, Left, Right work on both joysticks but not FIRE or the ARM button (fire2).
Whenever I copy a .vz file made with z88dk to my SD Card I get a notice:
Whenever I copy a .vz file made with z88dk to my SD Card I get a notice:
I'm also testing an Arcade Game Designer as I assist a developer port it to support VZ computers. The VZ files made with that (which uses sjasm) does not have this properties dialog box in Windows.The file filename.vz has properties that can't be copied to the new location.
Are you sure you want to copy this file without its properties?