l12n Posted May 31 Share Posted May 31 I'm trying to switch to screen mode 2 in assembly. I tried doing so by modifying registers 0 and 1, but all I get is a blank screen. Or should I do it another way? I see the BIOS contains a MODE_1 function but no MODE_2. Quote Link to comment https://forums.atariage.com/topic/367349-using-screen-mode-2-in-assembly/ Share on other sites More sharing options...
Tony Cruise Posted May 31 Share Posted May 31 I use the following settings for Screen mode 2: WRITE_REGISTER: EQU $1fd9 ; ; Setup Screen 2,2 SETSCREEN2: LD BC,0002h ;Reg 0: Mode 2 CALL WRITE_REGISTER LD BC,0206h ; Name table 1800h CALL WRITE_REGISTER LD BC,03ffh ; Colour table 2000h CALL WRITE_REGISTER LD BC,0403h ; Pattern table 0000h CALL WRITE_REGISTER LD BC,0536h ; Sprite attribute table 1b00h CALL WRITE_REGISTER LD BC,0607h ; Sprite pattern table 3800h CALL WRITE_REGISTER LD BC,0700h ; Base colours CALL WRITE_REGISTER LD BC,01c2h ;Reg 1: Mode 2, 16k, no interrupts, 16x16 sprites CALL WRITE_REGISTER RET You then need to populate both the pattern and colour tables 3 x 256 x 8 and set the values in the name table (matching the pattern numbers you want to display). 1 Quote Link to comment https://forums.atariage.com/topic/367349-using-screen-mode-2-in-assembly/#findComment-5477448 Share on other sites More sharing options...
l12n Posted May 31 Author Share Posted May 31 Works great, thanks! Quote Link to comment https://forums.atariage.com/topic/367349-using-screen-mode-2-in-assembly/#findComment-5477877 Share on other sites More sharing options...
artrag Posted June 1 Share Posted June 1 Mode 1 is already screen 2 I cannot understand the question... Quote Link to comment https://forums.atariage.com/topic/367349-using-screen-mode-2-in-assembly/#findComment-5478062 Share on other sites More sharing options...
Tony Cruise Posted June 5 Share Posted June 5 On 6/1/2024 at 5:05 PM, artrag said: Mode 1 is already screen 2 I cannot understand the question... Yep you are indeed correct, but for someone looking at the TMS manual very confusing Quote Link to comment https://forums.atariage.com/topic/367349-using-screen-mode-2-in-assembly/#findComment-5480389 Share on other sites More sharing options...
Captain Cozmos Posted June 18 Share Posted June 18 (edited) Tony's way is the easiest and strait forward but here is an alternative that I switched over to only because I had to reference the book so many times that I found it easier just to do it in binary. GRAPHICS_MODE_2: ; SET SCREEN MODE TO 32 COLUMN TEXT BY SENDING 16 BYTES TO THE VIDEO CONTROL PORT LD C, CTRL_PORT LD B, $10 ; 16 BYTES LD HL, MODE_2_REGISTERS OTIR RET MODE_2_REGISTERS: DB %00000010, 128+0 ; REG 0: MODE 2 DB %11000000, 128+1 ; REG 1: MODE 2, 16K, NO INTERRUPTS DB %00000110, 128+2 ; REG 2: NAME TABLE $1800 DB %11111111, 128+3 ; REG 3: COLOR TABLE $2000 DB %00000011, 128+4 ; REG 4: PATTERN TABLE $0000 DB %00110110, 128+5 ; REG 5: SPRITE ATTRIBUTE TABLE $1B00 DB %00000111, 128+6 ; REG 6: SRITE PATTERN TABLE $3800 DB %11110000, 128+7 ; REG 7: BACKGROUND COLOR TMS9928A.pdf Edited June 18 by Captain Cozmos Quote Link to comment https://forums.atariage.com/topic/367349-using-screen-mode-2-in-assembly/#findComment-5488002 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.