Post by homsar47 on Dec 15, 2013 22:56:11 GMT
Sorry if the title is a little bland, and extra apologies if this is in the wrong section. I'm not too familiar with this place.
So, here's my problem. If you go on Maxim's website, you will find a hello world example program.
Not a problem with that.
However, at the bottom is an extremely annoying block of text to store the font data.
In an attempt to get rid of this, I made an inc file with the font data, and it looks like this (well, a shortened version):
FontData:
.db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
FontDataEnd:
And the program itself that's being compiled looks like this (in another attempt to keep this thread short, I'm only posting the parts referencing what's in the .inc file):
.include "D:\MasterSystem\ASM\standard.inc"
;==============================================================
; Load tiles (font)
;==============================================================
; 1. Set VRAM write address to tile index 0
; by outputting $4000 ORed with $0000
ld a,$00
out ($bf),a
ld a,$40
out ($bf),a
; 2. Output tile data
ld hl,FontData ; Location of tile data
ld bc,FontDataEnd-FontData ; Counter for number of bytes to write
WriteTilesLoop:
; Output data byte then three zeroes, because our tile data is 1 bit
; and must be increased to 4 bit
ld a,(hl) ; Get data byte
out ($be),a
inc hl ; Add one to hl so it points to the next data byte
dec bc
ld a,b
or c
jp nz,WriteTilesLoop
;===============================================================
When the program is compiled, this is what ConTEXT captures out of compile.bat (there were LOTS or MEM_INSERT's, so I got rid of some of them):
MEM_INSERT: 2. write into $0000 (old: $00, new: $f3).
MEM_INSERT: 2. write into $0001 (old: $00, new: $ed).
MEM_INSERT: 2. write into $0002 (old: $00, new: $56).
MEM_INSERT: 2. write into $0003 (old: $00, new: $c3).
MEM_INSERT: 2. write into $0066 (old: $00, new: $ed).
MEM_INSERT: 2. write into $0067 (old: $00, new: $45).
MEM_INSERT: 2. write into $0068 (old: $7f, new: $31).
MEM_INSERT: 2. write into $0069 (old: $00, new: $f0).
MEM_INSERT: 2. write into $006a (old: $00, new: $df).
MEM_INSERT: 2. write into $006b (old: $00, new: $21).
MEM_INSERT: 2. write into $006e (old: $00, new: $06).
Bank 00 has 29649 bytes (90.48%) free.
Free space at $0c14-$7fdf.
Free space at $7ff8-$7ff9.
Free space at $7ffc-$7ffe.
29649 unused bytes of total 32768.
When running output.sms, it isn't pretty...
Honestly I have little to no previous experience with assembly, and truly have no idea why so many dots are appearing.
Anyone perhaps have a fix to this? Any more info you need, I'll give to you.
Thanks!
So, here's my problem. If you go on Maxim's website, you will find a hello world example program.
Not a problem with that.
However, at the bottom is an extremely annoying block of text to store the font data.
In an attempt to get rid of this, I made an inc file with the font data, and it looks like this (well, a shortened version):
FontData:
.db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
FontDataEnd:
And the program itself that's being compiled looks like this (in another attempt to keep this thread short, I'm only posting the parts referencing what's in the .inc file):
.include "D:\MasterSystem\ASM\standard.inc"
;==============================================================
; Load tiles (font)
;==============================================================
; 1. Set VRAM write address to tile index 0
; by outputting $4000 ORed with $0000
ld a,$00
out ($bf),a
ld a,$40
out ($bf),a
; 2. Output tile data
ld hl,FontData ; Location of tile data
ld bc,FontDataEnd-FontData ; Counter for number of bytes to write
WriteTilesLoop:
; Output data byte then three zeroes, because our tile data is 1 bit
; and must be increased to 4 bit
ld a,(hl) ; Get data byte
out ($be),a
inc hl ; Add one to hl so it points to the next data byte
dec bc
ld a,b
or c
jp nz,WriteTilesLoop
;===============================================================
When the program is compiled, this is what ConTEXT captures out of compile.bat (there were LOTS or MEM_INSERT's, so I got rid of some of them):
MEM_INSERT: 2. write into $0000 (old: $00, new: $f3).
MEM_INSERT: 2. write into $0001 (old: $00, new: $ed).
MEM_INSERT: 2. write into $0002 (old: $00, new: $56).
MEM_INSERT: 2. write into $0003 (old: $00, new: $c3).
MEM_INSERT: 2. write into $0066 (old: $00, new: $ed).
MEM_INSERT: 2. write into $0067 (old: $00, new: $45).
MEM_INSERT: 2. write into $0068 (old: $7f, new: $31).
MEM_INSERT: 2. write into $0069 (old: $00, new: $f0).
MEM_INSERT: 2. write into $006a (old: $00, new: $df).
MEM_INSERT: 2. write into $006b (old: $00, new: $21).
MEM_INSERT: 2. write into $006e (old: $00, new: $06).
Bank 00 has 29649 bytes (90.48%) free.
Free space at $0c14-$7fdf.
Free space at $7ff8-$7ff9.
Free space at $7ffc-$7ffe.
29649 unused bytes of total 32768.
When running output.sms, it isn't pretty...
Honestly I have little to no previous experience with assembly, and truly have no idea why so many dots are appearing.
Anyone perhaps have a fix to this? Any more info you need, I'll give to you.
Thanks!