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.
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..).
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
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.
What'd be the best way for me to do asm in my library? In the past I added vz_score and vz_bricks to 0crt.asm but should I just do it inline in my C library?
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.
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)
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.
How can I recompile a Z88dk callee .asm file so it is incorporated in my compilation of my code?
The vz_score and vz_brick calls were changed from what I wrote in 2000 and are now not working so I need to fix it for my new game.
I've updated vz_score_callee.asm but when I build it's still wrong.
Trying to work out how to pass values back from Z80 Assembly to my C code. I can't find any info on the z88dk wiki pages. I want to read the joystick values and give them back to C to work on. Any ideas?
#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
It's probably worth adding to the library to be honest - which emulator actually emulates the joystick?
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:
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?
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.