RSS Bot Posted July 9, 2013 Share Posted July 9, 2013 If I wanted to get bankswitching and sound working, then assembly would solve these 2 issues. Therefore, I need to start learning that. The C functions and the BIOS call function are very close what they do. Such as fill_vram, and etc. I do have the Colecovision programming, ZiLog z80, and tms9918a information on hand. I started on Saturday, and I was all worn out from working very hard from that morning. Fairly lousy day, and I wasn't feeling so well. So I decided just read about the z80 and http://www.z80.info/lesson1.htm did really good job explaining how the chip works. At least I know what the registers are for and how I may use them. I took a nap and realize how similar the actual C function in the getput/coleco library and the bios function. To use fill_vram in C, it's fill_vram(0x2000,0x20,1024);color table, change the half of the color table to dark green with black background. In assembly, I thought in my mind what if, ld a,0x20 (data) ld hl,0x2000 (possibly where to load the data to color table) ld de,1024 (count how time to do this) call FILL_VRAM So, that thought process made me try playing with assembly today. So I thought of how about I try to load my pattern, name, and color table. That was my very first objective that I did with my C programming project. I used the Helloworld assembly example since that file compiles. I managed to load my tiles and such with xor a ld hl,PATTERN ld de,$0000 ld bc,2048 call WRITE_VRAM same with the name table and the color table. The color table was set at 32 group of colors. So 'call MODE_1' will set up the screen for you from it preset of vdp registers. Therefore, the screen is set on screen mode 0. So I need to set the screen to screen mode 2. I searched for the tms9918a and set up the registers. I do so by, ld b,0 ld c,%00000010 call WRITE_REGISTER ld b,1 ld c,%11000010 call WRITE_REGISTER ld b,2 ld c,$06;name 1800 call WRITE_REGISTER ld b,3 ld c,$9f;color table 2000 call WRITE_REGISTER ld b,4 ld c,$3;pattern generator 0000 call WRITE_REGISTER ld b,5 ld c,$36;1b00 call WRITE_REGISTER ld b,6 ld c,$07;sprites call WRITE_REGISTER ld b,7 ld c,$F2 call WRITE_REGISTER This should work the same as Screen_mode_2_text function, where you have to load the pattern table to $0800 and $1000 to get around the sprite cloning issue. I don't have the interrupt bit on, but I think it need to stay off until the data is loaded to VRAM, then flip the interrupt on when the game is playing. I think rle compression probably use fill_vram, but that's worth building a function in my program. I'm excited to gain some ground with this language. I will be experiment with the sound since the bios sound set up looks similar to C programming set up. It need the address of the table of sounds on ROM so it'll load the 16 bit value to address 7020. Then PLAY_IT. http://atariage.com/forums/blog/340/entry-10334-learning-and-working-in-assembly/ Link to comment Share on other sites More sharing options...
Recommended Posts