Kiwi Posted February 9, 2016 Share Posted February 9, 2016 I was wondering where the font is located on the memory map. I want to know for future reference or now, just in case I need to gain back ROM space to cram more stuff into 32KB. Upload_default_ascii(BOLD_ITALIC); command just uploads content to vram 0x0000-0x0400. I do just need to write to VRAM address 0x0100-0x02FF. Something like put_vram(0x0100,0x0???,512) might work. I'm not sure if the fonts are encoded in someway. I do think that the lower case, bold, italic are generated from the original Coleco font images. So I should be able to upload the original font image to VRAM. Quote Link to comment Share on other sites More sharing options...
+nanochess Posted February 9, 2016 Share Posted February 9, 2016 0x15a3 points to the SPACE character followed by the exclamation mark and so. 1 Quote Link to comment Share on other sites More sharing options...
Kiwi Posted February 9, 2016 Author Share Posted February 9, 2016 Cool, I got the font from the BIOS to load!! Thank you nanochess! put_vram(0x0100,0x15a3,512); works. 0x15a3 will trigger the SDCC warning. Rockcutter.c:5344: warning 154: converting integral to pointer without a castfrom type 'const-int literal'to type 'void generic* fixed' I just ignore the warning. 1 Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted February 9, 2016 Share Posted February 9, 2016 Based on that error I'd just use the following :- put_vram(0x0100,(void*)0x15a3,512); 2 Quote Link to comment Share on other sites More sharing options...
Kiwi Posted February 9, 2016 Author Share Posted February 9, 2016 Based on that error I'd just use the following :- put_vram(0x0100,(void*)0x15a3,512); Thank you, that works. Now there's no more warning 1 Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted February 9, 2016 Share Posted February 9, 2016 Its always a good policy to fix your warnings so that you get a clean build. Often I'll turn up the compilers error/warning levels to get the best error/warning coverage possible. Quote Link to comment Share on other sites More sharing options...
Tursi Posted February 10, 2016 Share Posted February 10, 2016 It /is/ a good policy to always fix your warnings for a clean build - but I'll just throw in a secondary warning about casting. Do that only when you KNOW it's right, because it tells the compiler not to check that you are doing the right thing. In this case it's completely correct, you are typing an integer and you honestly mean for it to be a memory pointer. But I've seen people who resolve type warnings every time with a cast without checking why it was thrown, which isn't always the right answer. (for instance, used the wrong variable, defined something as not being a pointer when it was supposed to be, meant to dereference, etc) Quote Link to comment Share on other sites More sharing options...
Kiwi Posted February 10, 2016 Author Share Posted February 10, 2016 I assumed that put_vram(0x0100,0x15a3,512); will translate toxor ald hl,$15a3ld de,$0100ld bc,512call WRITE_VRAM It'll work anyway. Pointer name address will change into bytes after compiling. And yes, I learned the hardway of ignoring warnings. So much red, that it wouldn't show what caused the fatal error and refuse to compile. It changed my habit how I code and fix my warnings when it pops up. Quote Link to comment Share on other sites More sharing options...
Tursi Posted February 10, 2016 Share Posted February 10, 2016 Of course it will work anyway. Adding the (void*) doesn't change the generated code in any way, it just tells the compiler that yes, you meant that. Warnings are there to help you understand that the compiler discovered an ambiguity, and it might not have made the right choice. 1 Quote Link to comment Share on other sites More sharing options...
youki Posted February 10, 2016 Share Posted February 10, 2016 From my experience taking care of warning also allow you to save ROM space as well. Just by resolving the warning in Knight 'n More , i just save about 200 bytes!!!. That's enormous knowing that the ROM before i take care of warning was exactly 32768 bytes. It gave me the fresh air i needed to complete the game! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.