1 %include "WonderSwan.inc"
\r
6 ; Set Maps and Sprite Table at the end of first part of ram
\r
7 fgmap equ WSC_TILE_BANK1-MAP_SIZE
\r
8 bgmap equ fgmap-MAP_SIZE
\r
9 sprtable equ bgmap-SPR_TABLE_SIZE
\r
15 ;PADDING 15 ; Pad 15 Sections
\r
22 cli ; Disable Interrupts
\r
23 cld ; Offset in Increment mode
\r
25 xor ax,ax ; Clear all registers
\r
31 mov ds,ax ; Clear Segments
\r
34 mov bp,ax ; Setup stack
\r
38 in al,IO_HARDWARE_TYPE ; Check Wonderswan Mono/Color
\r
40 .mono: jz .mono ; We loop forever if Mono
\r
42 mov sp,WSC_STACK ; New stack
\r
44 xor ax,ax ; Clear Ram
\r
53 or al,VMODE_16C_CHK | VMODE_CLEANINIT
\r
54 out IO_VIDEO_MODE,al
\r
66 mov al,BG_MAP(bgmap) | FG_MAP(fgmap)
\r
69 mov al,SPR_TABLE(sprtable)
\r
83 mov di,INTVEC_VBLANK_START
\r
86 mov word [es:di],VBlank
\r
87 mov word [es:di+0x2],MYSEGMENT
\r
89 xor ax,ax ; Clear HBL & Timer
\r
90 out IOw_HBLANK_FREQ,ax
\r
91 out IO_TIMER_CTRL,al
\r
93 dec al ; Ack all Int
\r
96 mov al,INT_VBLANK_START ; Enable VBL Int
\r
97 out IO_INT_ENABLE,al
\r
99 sti ; Enable Interrupts !
\r
101 ;--------------------------------
\r
103 ; Set Segments for Copy
\r
112 mov di,WSC_TILE_BANK1
\r
113 mov cx,(TileGfxE-TileGfx)/2
\r
117 mov di,WSC_PALETTES
\r
121 mov ax,BG_CHR(0,0,0,0,0) ; Initial Tile, Pal 0, Bank 0
\r
123 mov cx,MAP_TWIDTH*MAP_THEIGHT
\r
127 mov al,BG_ON | FG_ON
\r
128 out IO_DISPLAY_CTRL,al
\r
130 ; Loop Read Buttons
\r
132 mov al,KEYPAD_READ_BUTTONS
\r
140 test al,PAD_A ; Press A for Audio
\r
145 ;******************************************
\r
156 in al,IO_BG_X ; Infinite Scroll
\r
166 or al,INT_VBLANK_START
\r
172 ;******************************************
\r
176 TilePal: incbin "gfx/bgtile.pal"
\r
177 TileGfx: incbin "gfx/bgtile.gfx"
\r
180 ;******************************************
\r
182 ROM_HEADER Start, MYSEGMENT, 0x42, RH_WS_COLOR, RH_ROM_8MBITS, RH_NO_SRAM, RH_HORIZONTAL
\r
184 ;******************************************
\r
186 SECTION BSS start=0x0100 ; Keep space for Int Vectors
\r
188 VBLcnt: resb 0 ; Our datas in RAM
\r